-
Notifications
You must be signed in to change notification settings - Fork 145
fix: replace deprecated AccountCreateTransaction.set_key usage #1355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: replace deprecated AccountCreateTransaction.set_key usage #1355
Conversation
|
[commit-verification-bot] To achieve verified status, please read: Remember, you require a GPG key and each commit must be signed with: Thank you for contributing! From the Hiero Python SDK Team |
1cbc559 to
c576538
Compare
📝 WalkthroughWalkthroughReplaced deprecated AccountCreateTransaction.set_key() usages with new methods: set_key_without_alias() across docs, examples, and tests; added set_key_with_alias() for alias-specific scenarios. No other behavioral or control-flow changes were introduced. Changes
Sequence Diagram(s)Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used📓 Path-based instructions (1)tests/unit/**/*⚙️ CodeRabbit configuration file
Files:
🧠 Learnings (1)📓 Common learnings🧬 Code graph analysis (1)tests/unit/account_create_transaction_test.py (1)
🪛 Ruff (0.14.10)tests/unit/account_create_transaction_test.py388-388: (PT011) ⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
have you set up a GPG key and attached it to your github account in the correct place? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 6
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (14)
tests/integration/revenue_generating_topics_e2e_test.py (3)
1-985: Consider adding resource cleanup to prevent state accumulation.Integration tests create accounts, topics, and tokens but lack explicit teardown. Over time, this can accumulate state on the test network, potentially causing resource exhaustion or increased costs.
Recommendations:
- Add pytest fixtures with teardown (e.g.,
@pytest.fixture(scope="function")) to delete created topics and accounts- Or implement a cleanup phase at the end of each test that deletes resources
- Consider using a context manager pattern for resource lifecycle management
Based on coding guidelines (PRIORITY 3 - Isolation & Cleanup).
331-331: Strengthen balance assertions for better failure diagnosis.Several balance assertions use inequality checks that verify direction (fee charged/not charged) but don't validate exact amounts:
- Lines 331, 381:
balance < hbar_amount // 2- verifies fee was charged but not the exact amount- Lines 560, 799-802:
balance > hbar_amount // 2- verifies fee was NOT charged but impreciseRecommendation:
Consider asserting expected exact balances or tighter ranges. For example:# More precise assertion expected_balance = hbar_amount - (hbar_amount // 2) - transaction_fee assert abs(account_info.balance.to_tinybars() - expected_balance) < toleranceThis would catch scenarios where fees are partially applied or miscalculated, improving regression detection when tests fail in CI.
Based on coding guidelines (PRIORITY 4 - Assertions & Coverage).
Also applies to: 381-381, 560-560, 799-802
1-985: Consider splitting into smaller test modules.At 985 lines with 17 test functions, this file is quite monolithic. Splitting by feature area would improve maintainability and test discovery:
Suggested structure:
revenue_topics_create_update_test.py- creation and update testsrevenue_topics_hbar_fees_test.py- HBAR fee charging testsrevenue_topics_token_fees_test.py- token fee charging testsrevenue_topics_exempt_keys_test.py- fee exemption testsrevenue_topics_limits_test.py- limit and error condition testsThis would make it easier to run specific test subsets and locate relevant tests when debugging failures.
Based on coding guidelines (PRIORITY 2 - Test Structure & Maintainability).
examples/tokens/token_wipe_transaction.py (1)
10-18: Optional: Consider consistent import style for transaction classes.
TokenAssociateTransactionis imported from the top level (line 17), whileAccountCreateTransactionuses a fully qualified path (line 18). For consistency, consider importing both the same way ifAccountCreateTransactionis available at the package level.examples/logger/logging_example.py (1)
110-125: Missing explicitResponseCode.SUCCESSvalidation.The transaction executes correctly, but per SDK example guidelines, receipt status should be explicitly validated against
ResponseCode.SUCCESSrather than relying solely on exception handling. Other examples in this PR demonstrate the recommended pattern.🔎 Suggested improvement
try: receipt = transaction.execute(client) + if receipt.status != ResponseCode.SUCCESS: + print(f" Account creation {description}failed: {ResponseCode(receipt.status).name}") + return None account_id = receipt.account_id print(f" Account creation {description}successful. Account ID: {account_id}") return str(account_id) except Exception as e: print(f" Account creation {description}failed: {str(e)}") return NoneNote: You'll need to add
ResponseCodeto the imports at line 17.examples/query/transaction_record_query.py (1)
54-75: Consider adding explicitfreeze_with(client)for user clarity.The
set_key_without_alias()migration is correct and receipt validation is present. However, per example guidelines emphasizing "explicitness over brevity," consider adding.freeze_with(client)before.execute(client)to demonstrate the complete transaction lifecycle pattern that users should follow.🔎 Suggested improvement
# Create the account receipt = ( AccountCreateTransaction() .set_key_without_alias(new_account_key.public_key()) .set_initial_balance(Hbar(1)) + .freeze_with(client) .execute(client) )tests/integration/transaction_record_query_e2e_test.py (1)
102-103: Missing@pytest.mark.integrationdecorator.This test function lacks the
@pytest.mark.integrationmarker that the other two test functions in this file have. This inconsistency could cause the test to be skipped or run unexpectedly depending on pytest configuration.🔎 Proposed fix
+@pytest.mark.integration def test_transaction_record_query_can_execute_fungible_transfer(): env = IntegrationTestEnv()examples/tokens/account_allowance_approve_transaction.py (1)
51-57: Critical: Missingfreeze_with(client)beforeexecute(client).The transaction lifecycle is incomplete. Per SDK best practices,
freeze_with(client)must be called beforeexecute(client)to properly finalize the transaction before submission.🔎 Proposed fix
account_receipt = ( AccountCreateTransaction() .set_key_without_alias(account_public_key) .set_initial_balance(Hbar(1)) .set_account_memo("Account for token allowance") + .freeze_with(client) .execute(client) )examples/tokens/token_revoke_kyc_transaction.py (1)
2-3: Fix typo in usage docstring.The filename has duplicate
.pyextensions in the usage examples, which will cause copy-paste errors for users.🔎 Proposed fix
-uv run examples/tokens/token_revoke_kyc_transaction.py.py -python examples/tokens/token_revoke_kyc_transaction.py.py +uv run examples/tokens/token_revoke_kyc_transaction.py +python examples/tokens/token_revoke_kyc_transaction.pytests/integration/account_update_transaction_e2e_test.py (5)
186-186: Incomplete migration: deprecatedset_key()still in use.Line 186 still uses the deprecated
set_key()method. For consistency with the rest of this PR, it should be migrated toset_key_without_alias().🔎 Suggested fix
- .set_key(env.operator_key.public_key()) + .set_key_without_alias(env.operator_key.public_key())
238-238: Incomplete migration: deprecatedset_key()still in use.Line 238 still uses the deprecated
set_key()method. For consistency with the rest of this PR, it should be migrated toset_key_without_alias().🔎 Suggested fix
- .set_key(env.operator_key.public_key()) + .set_key_without_alias(env.operator_key.public_key())
276-276: Incomplete migration: deprecatedset_key()still in use.Line 276 still uses the deprecated
set_key()method. For consistency with the rest of this PR, it should be migrated toset_key_without_alias().🔎 Suggested fix
- .set_key(env.operator_key.public_key()) + .set_key_without_alias(env.operator_key.public_key())
305-305: Incomplete migration: deprecatedset_key()still in use.Line 305 still uses the deprecated
set_key()method. For consistency with the rest of this PR, it should be migrated toset_key_without_alias().🔎 Suggested fix
- .set_key(env.operator_key.public_key()) + .set_key_without_alias(env.operator_key.public_key())
383-383: Incomplete migration: deprecatedset_key()still in use.Line 383 still uses the deprecated
set_key()method. For consistency with the rest of this PR, it should be migrated toset_key_without_alias().🔎 Suggested fix
- .set_key(env.operator_key.public_key()) + .set_key_without_alias(env.operator_key.public_key())
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (53)
CHANGELOG.mddocs/sdk_users/running_examples.mdexamples/account/account_allowance_approve_transaction_hbar.pyexamples/account/account_allowance_approve_transaction_nft.pyexamples/account/account_allowance_delete_transaction_hbar.pyexamples/account/account_allowance_delete_transaction_nft.pyexamples/account/account_create_transaction.pyexamples/account/account_delete_transaction.pyexamples/account/account_records_query.pyexamples/account/account_update_transaction.pyexamples/consensus/topic_create_transaction_revenue_generating.pyexamples/logger/logging_example.pyexamples/query/account_balance_query_2.pyexamples/query/account_info_query.pyexamples/query/transaction_get_receipt_query.pyexamples/query/transaction_record_query.pyexamples/schedule/schedule_create_transaction.pyexamples/schedule/schedule_delete_transaction.pyexamples/schedule/schedule_info_query.pyexamples/schedule/schedule_sign_transaction.pyexamples/tokens/account_allowance_approve_transaction.pyexamples/tokens/token_airdrop_claim_auto.pyexamples/tokens/token_airdrop_claim_signature_required.pyexamples/tokens/token_airdrop_transaction.pyexamples/tokens/token_airdrop_transaction_cancel.pyexamples/tokens/token_associate_transaction.pyexamples/tokens/token_create_transaction_freeze_key.pyexamples/tokens/token_create_transaction_kyc_key.pyexamples/tokens/token_create_transaction_max_automatic_token_associations_0.pyexamples/tokens/token_create_transaction_pause_key.pyexamples/tokens/token_create_transaction_wipe_key.pyexamples/tokens/token_dissociate_transaction.pyexamples/tokens/token_grant_kyc_transaction.pyexamples/tokens/token_reject_transaction_fungible_token.pyexamples/tokens/token_reject_transaction_nft.pyexamples/tokens/token_revoke_kyc_transaction.pyexamples/tokens/token_wipe_transaction.pyexamples/transaction/transfer_transaction_fungible.pyexamples/transaction/transfer_transaction_hbar.pyexamples/transaction/transfer_transaction_nft.pytests/integration/account_info_query_e2e_test.pytests/integration/account_update_transaction_e2e_test.pytests/integration/batch_transaction_e2e_test.pytests/integration/query_e2e_test.pytests/integration/revenue_generating_topics_e2e_test.pytests/integration/token_grant_kyc_transaction_e2e_test.pytests/integration/token_reject_transaction_e2e_test.pytests/integration/token_revoke_kyc_transaction_e2e_test.pytests/integration/token_update_transaction_e2e_test.pytests/integration/transaction_record_query_e2e_test.pytests/integration/utils.pytests/unit/account_create_transaction_test.pytests/unit/executable_test.py
🧰 Additional context used
📓 Path-based instructions (5)
examples/**/*
⚙️ CodeRabbit configuration file
examples/**/*: You are acting as a senior maintainer reviewing SDK examples. Your goal is to ensure examples work verbatim for users who copy-paste them.Priority 1 - Correctness:
- Verify transaction lifecycle chain (construction -> freeze_with -> sign -> execute).
- Ensure
freeze_with(client)is called BEFORE signing.- Validate that methods referenced actually exist in the
hiero_sdk_pythoncodebase.- Ensure response validation checks
receipt.statusagainstResponseCodeenums (e.g.,ResponseCode.SUCCESS).Priority 2 - Transaction Lifecycle:
- Check method chaining logic.
- Verify correct signing order (especially for multi-sig).
- Ensure explicit
.execute(client)calls.- Verify response property extraction (e.g., using
.token_id,.account_id,.serial_numbers).- Ensure error handling uses
ResponseCode(receipt.status).namefor clarity.Priority 3 - Naming & Clarity:
- Enforce role-based naming:
operator_id/_key,treasury_account_id/_key,receiver_id/_key.- Use
_idsuffix for AccountId and_keysuffix for PrivateKey variables.- Validate negative examples explicitly check for failure codes (e.g.,
TOKEN_HAS_NO_PAUSE_KEY).- Ensure logical top-to-bottom flow without ambiguity.
Priority 4 - Consistency:
- Verify standard patterns:
def main(),if __name__ == "__main__":,load_dotenv().- IMPORT RULES:
- Accept both top-level imports (e.g.,
from hiero_sdk_python import PrivateKey) and fully qualified imports (e.g.,from hiero_sdk_python.crypto.private_key import PrivateKey).- STRICTLY validate that the import path actually exists in the project structure. Compare against other files in
/examplesor your knowledge of the SDK file tree.- Flag hallucinations immediately (e.g.,
hiero_sdk_python.keysdoes not exist).- Check for
try-exceptblocks withsys.exit(1)for critical failures.Priority 5 - User Experience:
- Ensure comments explain SDK usage patterns (for users,...
Files:
examples/schedule/schedule_create_transaction.pyexamples/query/transaction_get_receipt_query.pyexamples/consensus/topic_create_transaction_revenue_generating.pyexamples/schedule/schedule_delete_transaction.pyexamples/query/account_balance_query_2.pyexamples/transaction/transfer_transaction_hbar.pyexamples/account/account_create_transaction.pyexamples/tokens/token_create_transaction_freeze_key.pyexamples/account/account_allowance_delete_transaction_hbar.pyexamples/transaction/transfer_transaction_fungible.pyexamples/query/account_info_query.pyexamples/transaction/transfer_transaction_nft.pyexamples/tokens/token_dissociate_transaction.pyexamples/account/account_update_transaction.pyexamples/tokens/token_revoke_kyc_transaction.pyexamples/tokens/token_grant_kyc_transaction.pyexamples/tokens/token_reject_transaction_nft.pyexamples/tokens/token_create_transaction_kyc_key.pyexamples/account/account_allowance_approve_transaction_hbar.pyexamples/tokens/token_associate_transaction.pyexamples/tokens/token_create_transaction_max_automatic_token_associations_0.pyexamples/tokens/token_airdrop_claim_auto.pyexamples/tokens/account_allowance_approve_transaction.pyexamples/logger/logging_example.pyexamples/schedule/schedule_sign_transaction.pyexamples/tokens/token_wipe_transaction.pyexamples/tokens/token_airdrop_transaction_cancel.pyexamples/tokens/token_reject_transaction_fungible_token.pyexamples/query/transaction_record_query.pyexamples/tokens/token_create_transaction_pause_key.pyexamples/tokens/token_airdrop_claim_signature_required.pyexamples/tokens/token_airdrop_transaction.pyexamples/account/account_allowance_delete_transaction_nft.pyexamples/tokens/token_create_transaction_wipe_key.pyexamples/account/account_delete_transaction.pyexamples/schedule/schedule_info_query.pyexamples/account/account_allowance_approve_transaction_nft.pyexamples/account/account_records_query.py
tests/unit/**/*
⚙️ CodeRabbit configuration file
tests/unit/**/*: You are acting as a senior maintainer reviewing unit tests for the hiero-sdk-python project. Your goal is to ensure tests are extensive, deterministic, and protect against breaking changes.CRITICAL PRINCIPLES - Tests Must Fail Loudly & Deterministically:
- Tests must provide useful error messages when they fail for future debugging.
- No
print()statements - use assertions with descriptive messages.- No timing-dependent or unseeded random assertions.
- No network calls or external dependencies (unit tests are isolated).
- No unjustified TODOs or skipped tests without tracking issues.
PRIORITY 1 - Protect Against Breaking Changes:
- Assert public attributes exist (e.g.,
assert hasattr(obj, 'account_id')).- Assert return types where relevant (e.g.,
assert isinstance(result, AccountId)).- Assert fluent setters return
self(e.g.,assert tx.set_memo("test") is tx).- Assert backward-compatible defaults are maintained.
- If a breaking change is introduced, tests must assert deprecation behavior and test old behavior until removal.
PRIORITY 2 - Constructor & Setter Behavior:
- Test constructor behavior with valid inputs, edge cases, and invalid inputs.
- Test setter behavior including method chaining (fluent interface).
- Verify that setters validate input and raise appropriate exceptions.
- Test that getters return expected values after construction/setting.
PRIORITY 3 - Comprehensive Coverage:
- Unit tests should be extensive - test even if we don't expect users to use it currently.
- Cover happy paths AND unhappy paths/edge cases.
- Test boundary conditions, null/None values, empty collections, etc.
- Avoid brittle ordering assertions unless order is part of the contract.
PRIORITY 4 - No Mocks for Non-Existent Modules:
- All imports must reference actual SDK modules - no hallucinated paths.
- Validate import paths against the actual
src/hiero_sdk_pythonstructure.- Mocks should only be used for external de...
Files:
tests/unit/executable_test.pytests/unit/account_create_transaction_test.py
tests/integration/**/*
⚙️ CodeRabbit configuration file
tests/integration/**/*: You are acting as a senior maintainer reviewing integration tests for the hiero-sdk-python project. Your goal is to ensure end-to-end tests validate real network behavior safely and deterministically.CRITICAL PRINCIPLES - Safety & Diagnosability:
- Prioritize safety: No implicit or default mainnet usage.
- Secrets and credentials must be injected safely (env vars, not hardcoded).
- Test failures must be diagnosable with clear error messages.
- Tests must assert observable network behavior, not just
SUCCESS.- Failure-path tests must assert specific
ResponseCodevalues (e.g.,TOKEN_HAS_NO_PAUSE_KEY).PRIORITY 1 - End-to-End Behavior:
- Tests should be end-to-end: construct → freeze → sign → execute → verify.
- Validate resulting balances, ownership, and state changes (not just transaction success).
- Assert transaction receipts contain expected data (IDs, serial numbers, etc.).
- Verify network state after operations (e.g., account balance changed, token transferred).
PRIORITY 2 - Test Structure & Maintainability:
- One major behavior per test (clear focus).
- Tests should be readable: clear names, brief docstrings, key inline comments.
- Minimal abstraction layers - prefer clarity over DRY.
- Is the file too monolithic? Flag if tests should be split into smaller modules.
- Are helper functions good candidates for pytest fixtures or shared utilities?
PRIORITY 3 - Isolation & Cleanup:
- Local account creation over operator reuse (avoid state pollution).
- Are accounts, tokens, and allowances properly cleaned up to avoid state leakage?
- Recommend teardown strategies or fixture scoping improvements.
- Tests should not depend on execution order (avoid brittle assumptions).
PRIORITY 4 - Assertions & Coverage:
- Do tests validate only success/failure, or also assert resulting state?
- Suggest additional assertions that would strengthen correctness (balances, allowances, ownership).
- Cover happy paths AND ...
Files:
tests/integration/token_grant_kyc_transaction_e2e_test.pytests/integration/revenue_generating_topics_e2e_test.pytests/integration/utils.pytests/integration/token_reject_transaction_e2e_test.pytests/integration/transaction_record_query_e2e_test.pytests/integration/batch_transaction_e2e_test.pytests/integration/token_update_transaction_e2e_test.pytests/integration/account_info_query_e2e_test.pytests/integration/account_update_transaction_e2e_test.pytests/integration/token_revoke_kyc_transaction_e2e_test.pytests/integration/query_e2e_test.py
docs/**
⚙️ CodeRabbit configuration file
docs/**: You are reviewing documentation for the Hiero Python SDK. These pages serve both SDK users and SDK developers.Priority 1 - Correctness (code, commands, links)
- Verify code snippets conceptually run and match the current SDK API.
- Check shell commands and workflow steps against actual project tooling.
- Validate URLs and cross-references; flag broken or misleading links.
Priority 2 - Clarity and completeness
- Ensure each page states its purpose and expected outcome early.
- Prefer concrete, step-wise explanations over vague descriptions.
- Highlight missing prerequisites that would block a reader.
- For larger gaps, suggest filing a follow-up issue instead of blocking.
Priority 3 - Consistency and navigation
- Encourage consistent terminology with the SDK and examples.
- Check headings form a logical reading path.
- Confirm each page makes clear which audience it serves.
PHILOSOPHY
- Treat docs as work-in-progress: optimize for correctness and clarity over perfection.
- Keep feedback concise, action-oriented, and focused on reader success.
- Do not request large-scale restructures unless current structure blocks understanding.
AVOID
- Avoid lint-style feedback on Markdown formatting or minor wording.
- Avoid proposing new conventions without clear benefit.
- Avoid turning every high-level gap into a blocker.
Files:
docs/sdk_users/running_examples.md
docs/sdk_users/**
⚙️ CodeRabbit configuration file
docs/sdk_users/**: These documents are for SDK users who want to USE the Hiero Python SDK quickly and correctly.Priority 1 - High-level guidance
- Ensure explanations are conceptual and point to
/examplesfor runnable code.- Check that required environment variables and network choices are clearly stated.
Priority 2 - No hidden assumptions
- Assume zero prior knowledge of this SDK and minimal Hedera background.
- Avoid requiring knowledge of repository layout or contribution workflow.
PHILOSOPHY
- Keep explanations high-level and conceptual; defer runnable examples to
/examples.- Focus on what users need to know before diving into code examples.
Files:
docs/sdk_users/running_examples.md
🧬 Code graph analysis (51)
examples/schedule/schedule_create_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/query/transaction_get_receipt_query.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/consensus/topic_create_transaction_revenue_generating.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/schedule/schedule_delete_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/query/account_balance_query_2.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/transaction/transfer_transaction_hbar.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
tests/unit/executable_test.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (2)
PrivateKey(14-471)public_key(305-309)
examples/account/account_create_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
tests/integration/token_grant_kyc_transaction_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
tests/integration/revenue_generating_topics_e2e_test.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/tokens/token_create_transaction_freeze_key.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/account/account_allowance_delete_transaction_hbar.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/transaction/transfer_transaction_fungible.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/query/account_info_query.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
tests/integration/utils.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/transaction/transfer_transaction_nft.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/tokens/token_dissociate_transaction.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/account/account_update_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/tokens/token_revoke_kyc_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
tests/integration/token_reject_transaction_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (2)
set_key_without_alias(94-107)AccountCreateTransaction(27-380)
examples/tokens/token_grant_kyc_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
tests/integration/transaction_record_query_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
tests/unit/account_create_transaction_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (4)
set_key_without_alias(94-107)set_key_with_alias(109-135)AccountCreateTransaction(27-380)set_alias(220-244)
tests/integration/batch_transaction_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (2)
set_key_without_alias(94-107)AccountCreateTransaction(27-380)
examples/tokens/token_reject_transaction_nft.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/tokens/token_create_transaction_kyc_key.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/account/account_allowance_approve_transaction_hbar.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/tokens/token_associate_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
tests/integration/token_update_transaction_e2e_test.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/tokens/token_create_transaction_max_automatic_token_associations_0.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/tokens/token_airdrop_claim_auto.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
tests/integration/account_info_query_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/tokens/account_allowance_approve_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/logger/logging_example.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/schedule/schedule_sign_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/tokens/token_wipe_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/tokens/token_airdrop_transaction_cancel.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/tokens/token_reject_transaction_fungible_token.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/query/transaction_record_query.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/tokens/token_create_transaction_pause_key.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/tokens/token_airdrop_claim_signature_required.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/tokens/token_airdrop_transaction.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/account/account_allowance_delete_transaction_nft.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/tokens/token_create_transaction_wipe_key.py (3)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)tests/unit/conftest.py (1)
private_key(54-56)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/account/account_delete_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/schedule/schedule_info_query.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
tests/integration/account_update_transaction_e2e_test.py (3)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)tests/integration/utils.py (1)
env(23-27)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
tests/integration/token_revoke_kyc_transaction_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/account/account_allowance_approve_transaction_nft.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/account/account_records_query.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
tests/integration/query_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (56)
tests/integration/revenue_generating_topics_e2e_test.py (2)
529-539: LGTM: Correct API migration for fee-exempt account creation.The migration from
set_key()toset_key_without_alias()is correct. The method appropriately creates an account with the fee-exempt key without establishing an alias, which aligns with the test's intent to verify fee exemption behavior.
592-602: LGTM: Consistent API migration.The migration matches the pattern established at line 531 and is correct for this fee-exempt token scenario.
examples/tokens/token_wipe_transaction.py (1)
53-58: LGTM! Correct migration to non-deprecated method.The replacement of
set_key()withset_key_without_alias()is correct and aligns with the SDK's current API. The transaction lifecycle is properly constructed (build → freeze → execute), and the method accepts the public key as expected.examples/schedule/schedule_delete_transaction.py (1)
51-70: LGTM!The migration from
set_key()toset_key_without_alias()is correct. The transaction lifecycle follows the proper pattern: construct →freeze_with(client)→sign()→execute(client), with proper receipt status validation usingResponseCode.SUCCESS.tests/integration/utils.py (1)
54-67: LGTM!The
set_key_without_alias()migration is correct. Thecreate_accounthelper appropriately validates receipt status and raises a clearAssertionErroron failure, which is suitable for test utilities.tests/integration/transaction_record_query_e2e_test.py (1)
23-29: LGTM!The
set_key_without_alias()migration is correct with proper receipt status assertion.examples/query/account_balance_query_2.py (1)
57-72: LGTM!The
set_key_without_alias()migration is correct. Receipt validation againstResponseCode.SUCCESSis present with appropriatesys.exit(1)on failure.CHANGELOG.md (1)
137-138: LGTM!Changelog entry accurately documents the deprecation migration and follows the established format.
examples/schedule/schedule_create_transaction.py (1)
48-48: LGTM! Correct API migration.The change from
set_key()toset_key_without_alias()correctly updates to the non-deprecated API. The transaction lifecycle (freeze_with → sign → execute) is properly maintained.examples/query/transaction_get_receipt_query.py (1)
52-52: LGTM! Correct API migration.The change to
set_key_without_alias()properly updates the deprecated API call. The complete transaction lifecycle on line 55 (freeze_with → sign → execute) is correct.examples/transaction/transfer_transaction_fungible.py (1)
59-59: LGTM! Correct API migration.The replacement of
set_key()withset_key_without_alias()is correct. The transaction lifecycle on line 62 properly chainsfreeze_with → sign → execute.examples/account/account_records_query.py (1)
50-50: LGTM! Correct API migration.The change to
set_key_without_alias()properly replaces the deprecated method. The transaction lifecycle correctly includesfreeze_with(client)beforeexecute(client).examples/tokens/token_revoke_kyc_transaction.py (1)
111-111: LGTM!The migration from
set_key()toset_key_without_alias()is correct. The method properly accepts aPublicKey, and the transaction lifecycle (freeze → execute) follows SDK best practices.examples/tokens/token_airdrop_transaction_cancel.py (1)
58-58: LGTM!The API migration is correct, and the transaction lifecycle properly chains
freeze_with(client).sign(operator_key).execute(client)as expected.examples/tokens/token_create_transaction_pause_key.py (1)
197-197: LGTM!The migration to
set_key_without_alias()is correct. Transaction lifecycle follows the proper sequence: freeze → sign → execute.examples/schedule/schedule_sign_transaction.py (1)
59-59: LGTM!The API migration is correct, and the transaction properly follows the freeze → sign → execute lifecycle as required by the SDK.
examples/tokens/token_reject_transaction_nft.py (1)
59-59: LGTM on the API migration!The migration from
set_key()toset_key_without_alias()is correct. The method properly accepts aPublicKeytype.examples/schedule/schedule_info_query.py (1)
52-52: LGTM: API migration correctly applied.The replacement of
set_key()withset_key_without_alias()is correct and maintains the transaction lifecycle (construct → freeze → sign → execute). The change aligns with the SDK's migration away from the deprecated method.examples/tokens/token_airdrop_claim_signature_required.py (1)
101-101: LGTM: API migration correctly applied.The replacement of
set_key()withset_key_without_alias()is correct. Transaction lifecycle remains intact (freeze → sign → execute), and error handling properly validatesResponseCode.SUCCESS.examples/account/account_create_transaction.py (1)
78-78: LGTM: API migration correctly applied.The replacement of
set_key()withset_key_without_alias()is correct and preserves the transaction lifecycle. Variable naming (new_account_public_key,operator_key) and error handling follow best practices.examples/account/account_update_transaction.py (1)
47-47: LGTM: API migration correctly applied.The replacement of
set_key()withset_key_without_alias()is correct. Transaction lifecycle and error handling (includingsys.exit(1)on failure) follow SDK example conventions.tests/integration/token_grant_kyc_transaction_e2e_test.py (1)
22-22: LGTM: API migration correctly applied across all three tests.All three replacements of
set_key()withset_key_without_alias()are correct. Transaction lifecycles remain intact, and the tests properly validate end-to-end behavior including:
- Successful account creation (
ResponseCode.SUCCESS)- Negative paths with specific error codes (
TOKEN_HAS_NO_KYC_KEY,TOKEN_NOT_ASSOCIATED_TO_ACCOUNT)The changes maintain test clarity and correctness.
Also applies to: 65-65, 119-119
tests/integration/token_update_transaction_e2e_test.py (2)
113-113: LGTM: API migration is correct.The migration from
set_key()toset_key_without_alias()is consistent with the PR objectives and maintains the same account creation behavior.
177-177: LGTM: API migration is correct.The migration from
set_key()toset_key_without_alias()is consistent with the PR objectives and maintains the same account creation behavior.examples/account/account_allowance_approve_transaction_hbar.py (1)
70-70: LGTM: Correct API migration.The change to
set_key_without_alias()aligns with the deprecated API migration and follows the proper transaction lifecycle. The example remains functional and clear for users.examples/tokens/token_create_transaction_kyc_key.py (1)
94-94: LGTM: Correct API migration.The change to
set_key_without_alias()aligns with the deprecated API migration and maintains the proper transaction lifecycle (freeze_with → sign → execute).examples/tokens/token_grant_kyc_transaction.py (1)
108-108: LGTM: Correct API migration.The change to
set_key_without_alias()aligns with the deprecated API migration and follows the proper transaction lifecycle pattern.examples/transaction/transfer_transaction_nft.py (1)
59-59: LGTM: Correct API migration.The change to
set_key_without_alias()aligns with the deprecated API migration and maintains the proper transaction lifecycle for account creation.examples/tokens/token_create_transaction_max_automatic_token_associations_0.py (1)
95-95: LGTM! Correct API migration.The replacement of deprecated
set_key()withset_key_without_alias()is correct. The transaction lifecycle is properly maintained (construct → freeze → sign → execute), and the method receives the correct argument type (public key).tests/integration/batch_transaction_e2e_test.py (2)
21-21: LGTM! Helper function correctly updated.The
create_account_txhelper properly usesset_key_without_alias()for account creation. This change is consistently applied across all test usages of this helper.
165-165: LGTM! All test account creations correctly migrated.All direct usages of account creation in tests have been properly updated to use
set_key_without_alias(). The test structure and assertions remain intact, validating end-to-end batch transaction behavior.Also applies to: 266-266, 282-282, 289-289, 297-297
examples/tokens/token_associate_transaction.py (1)
78-78: LGTM! Correct migration in token association example.The account creation properly uses
set_key_without_alias()with the new account's public key. Transaction lifecycle is correct (freeze_with before signing), and error handling validates the receipt status properly.examples/account/account_allowance_delete_transaction_nft.py (1)
73-73: LGTM! Account creation correctly updated.The
create_accounthelper properly usesset_key_without_alias()for account creation. The change aligns with the API migration and maintains the correct transaction execution pattern.examples/tokens/token_airdrop_claim_auto.py (1)
92-92: LGTM! Receiver account creation correctly migrated.The
create_receiverfunction properly usesset_key_without_alias()for account creation. The transaction lifecycle is correct (freeze_with → sign → execute), and error handling validates the receipt status with clear messaging.examples/tokens/token_create_transaction_freeze_key.py (1)
183-183: LGTM! Correct migration toset_key_without_alias().The change correctly replaces the deprecated
set_key()withset_key_without_alias()and properly passes the public key. The transaction lifecycle (construction → freeze_with → sign → execute) is correctly followed.docs/sdk_users/running_examples.md (1)
123-123: LGTM! Documentation correctly updated.The documentation accurately reflects the API change from
set_key()toset_key_without_alias()and demonstrates the correct transaction lifecycle pattern for users to follow.examples/transaction/transfer_transaction_hbar.py (1)
56-56: LGTM! Correct migration toset_key_without_alias().The change correctly replaces the deprecated
set_key()withset_key_without_alias()and properly passes the public key. The transaction lifecycle (construction → freeze_with → sign → execute) is correctly followed.tests/integration/query_e2e_test.py (1)
25-25: LGTM! API migration applied consistently.All five occurrences of
set_key()have been correctly replaced withset_key_without_alias(). The tests remain structurally sound with proper end-to-end flows (account creation → operator setup → query execution → balance verification) and appropriate cleanup.Also applies to: 75-75, 132-132, 171-171, 217-217
examples/account/account_allowance_approve_transaction_nft.py (1)
86-86: LGTM! Example correctly migrated to non-deprecated API.The helper function correctly uses
set_key_without_alias()with the public key derived from the generated private key. The example follows SDK patterns with appropriate transaction lifecycle and response validation.tests/integration/token_revoke_kyc_transaction_e2e_test.py (1)
23-23: LGTM! Consistent API migration across all test cases.All three test functions correctly use
set_key_without_alias(). The tests maintain robust end-to-end validation covering both success scenarios and specific failure modes (TOKEN_HAS_NO_KYC_KEY, TOKEN_NOT_ASSOCIATED_TO_ACCOUNT) with appropriate ResponseCode assertions.Also applies to: 75-75, 127-127
tests/integration/account_update_transaction_e2e_test.py (1)
28-28: LGTM! Five test functions correctly migrated.The changed lines properly use
set_key_without_alias()and the tests maintain their end-to-end validation structure with appropriate assertions.Also applies to: 104-104, 142-142, 341-341, 351-351
tests/integration/token_reject_transaction_e2e_test.py (1)
116-116: LGTM! All builder-pattern usages correctly migrated.The four occurrences using the builder pattern correctly use
set_key_without_alias(). Note that other tests in this file use the constructor patternAccountCreateTransaction(key=...)which directly sets the key parameter and doesn't involve the deprecatedset_key()method, so those are already compliant.Also applies to: 177-177, 883-883, 903-903
examples/tokens/token_airdrop_transaction.py (1)
59-59: LGTM - Correct migration to non-deprecated method.The replacement of
.set_key()with.set_key_without_alias()is correct and aligns with the PR's objective to migrate away from deprecated methods.tests/unit/account_create_transaction_test.py (7)
45-45: LGTM - Correct migration to non-deprecated method.The test now correctly uses
.set_key_without_alias()instead of the deprecated.set_key().
70-70: LGTM - Correct migration to non-deprecated method.The test now correctly uses
.set_key_without_alias()for the scheduled transaction body test.
105-105: LGTM - Correct migration to non-deprecated method.The test now correctly uses
.set_key_without_alias()for the signing test.
170-170: LGTM - Correct migration to non-deprecated method.The test now correctly uses
.set_key_without_alias()for the integration test.
237-237: LGTM - Correct migration to non-deprecated method.The test now correctly uses
.set_key_without_alias()for the max automatic token associations test.
386-386: LGTM - Correct migration to non-deprecated method.The test now correctly uses
.set_key_without_alias()for the invalid alias string test.
394-394: LGTM - Correct migration to non-deprecated method.The test now correctly uses
.set_key_without_alias()for the invalid alias type test.tests/integration/account_info_query_e2e_test.py (1)
31-31: LGTM - Correct migration to non-deprecated method.The integration test now correctly uses
.set_key_without_alias()instead of the deprecated.set_key().examples/account/account_allowance_delete_transaction_hbar.py (1)
43-43: LGTM - Correct migration to non-deprecated method.The example now correctly uses
.set_key_without_alias()instead of the deprecated.set_key().tests/unit/executable_test.py (1)
55-55: LGTM - Correct migration to non-deprecated method.All usages of
.set_key_without_alias()in this test file correctly replace the deprecated.set_key()method.examples/account/account_delete_transaction.py (1)
27-27: LGTM!Correct replacement of deprecated
set_key()withset_key_without_alias(). The transaction lifecycle (freeze → sign → execute) and response validation are properly implemented.examples/query/account_info_query.py (1)
57-57: LGTM!Correct replacement of deprecated
set_key()withset_key_without_alias(). The transaction lifecycle and response validation are properly implemented, following SDK best practices.examples/tokens/token_reject_transaction_fungible_token.py (1)
57-57: LGTM! Correct usage ofset_key_without_alias().The migration from deprecated
set_key()toset_key_without_alias()is correct. The method exists in the SDK (confirmed inaccount_create_transaction.py) and properly accepts thePublicKeytype for account creation without alias.
c576538 to
a74ddf6
Compare
|
My last branch was polluted and created a cleaned up the branch to a single signed commit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (15)
examples/account/account_records_query.py (1)
148-152: Missing.freeze_with(client)in transaction lifecycle.The
TransferTransactionshould call.freeze_with(client)before.execute(client)to follow the standard transaction lifecycle pattern (construction → freeze_with → execute). This matches the pattern used in theAccountCreateTransactionearlier in the file (lines 48-55).🔎 Proposed fix
receipt = ( TransferTransaction() .add_hbar_transfer(account_id, -Hbar(1).to_tinybars()) .add_hbar_transfer(original_operator_id, Hbar(1).to_tinybars()) + .freeze_with(client) .execute(client) )Note: This is a pre-existing issue, not introduced by this PR, but should be fixed to ensure examples demonstrate correct SDK usage patterns.
examples/account/account_allowance_approve_transaction_nft.py (2)
50-50: Inconsistent import style - consider moving to top-level imports.
AccountCreateTransactionuses a fully qualified import while all other transaction types (TokenCreateTransaction,TokenMintTransaction, etc.) are imported from the top-levelhiero_sdk_pythonpackage (lines 34-49). For examples that users copy-paste, consistent import patterns improve readability.🔎 Suggested refactor to align import style
Move
AccountCreateTransactionto the top-level import block:from hiero_sdk_python import ( Client, AccountId, PrivateKey, Network, Hbar, ResponseCode, + AccountCreateTransaction, TokenCreateTransaction, TokenType, SupplyType, TokenMintTransaction, NftId, TokenAssociateTransaction, AccountAllowanceApproveTransaction, TransferTransaction, ) -from hiero_sdk_python.account.account_create_transaction import AccountCreateTransaction
84-90: Consider explicitfreeze_with+signfor transaction lifecycle clarity.This transaction executes directly without explicit
freeze_with(client)andsign()calls, while other transactions in this file (e.g.,create_nft_token,associate_token_with_account,approve_nft_allowance) follow the full lifecycle pattern. For SDK examples that users copy-paste, consistent and explicit patterns help reinforce best practices.🔎 Suggested refactor for explicit transaction lifecycle
tx = ( AccountCreateTransaction() .set_key_without_alias(public_key) .set_initial_balance(Hbar(10)) .set_account_memo(memo) + .freeze_with(client) + ) + + receipt = tx.execute(client) + + if receipt.status != ResponseCode.SUCCESS: + print(f"Account creation failed: {ResponseCode(receipt.status).name}") - .execute(client) - ) - - if tx.status != ResponseCode.SUCCESS: - print(f"Account creation failed: {ResponseCode(tx.status).name}") sys.exit(1) - account_id = tx.account_id + account_id = receipt.account_id print(f"Created new account ({memo}): {account_id}") return account_id, private_keyNote: This same pattern appears in
mint_nft(line 131-136) andtransfer_nft_using_allowance(line 192-196). Consider applying consistently across the file.examples/account/account_allowance_delete_transaction_nft.py (2)
36-36: Optional: Import style inconsistency.Line 36 uses a fully qualified import for
AccountCreateTransaction, while lines 19-35 use top-level imports. Both styles are valid, but for consistency consider using the top-level import:-from hiero_sdk_python.account.account_create_transaction import AccountCreateTransaction +# Add to top-level imports above: +# AccountCreateTransaction,This is a minor style nitpick and not blocking.
71-77: Addfreeze_with(client)to AccountCreateTransaction for proper transaction lifecycle.The
AccountCreateTransactionat lines 71-77 omitsfreeze_with(client), which violates the transaction lifecycle guideline (Priority 1: construction → freeze_with → sign → execute). Nearly all otherAccountCreateTransactionexamples across the codebase include this call, and the same guideline is consistently applied to other transactions in this file (lines 98-111, 155-162, 186-192, 222-228).Recommended change
tx = ( AccountCreateTransaction() .set_key_without_alias(public_key) .set_initial_balance(Hbar(10)) .set_account_memo(memo) + .freeze_with(client) .execute(client) )examples/account/account_allowance_delete_transaction_hbar.py (1)
41-47: Transaction lifecycle deviates from standard example pattern.This example omits
.freeze_with(client)and.sign(account_private_key)before.execute(client), which differs from all other examples in this PR and the coding guidelines' expectation: "construction → freeze_with → sign → execute."While this may work (the SDK might auto-freeze and use the operator's signature), it creates inconsistency for users copying examples. Consider aligning with the standard pattern:
account_receipt = ( AccountCreateTransaction() .set_key_without_alias(account_public_key) .set_initial_balance(Hbar(1)) .set_account_memo("Account for hbar allowance") + .freeze_with(client) + .sign(account_private_key) .execute(client) )examples/transaction/transfer_transaction_fungible.py (1)
52-69: Add explicit receipt status validation.The
create_accountfunction lacks explicit validation ofreceipt.statusagainstResponseCode.SUCCESS. While the try-except block catches exceptions, it doesn't verify the transaction succeeded on the network. Other functions in this file (e.g.,create_token,associate_token) validate status explicitly.🔎 Proposed fix
try: tx = ( AccountCreateTransaction() .set_key_without_alias(recipient_key.public_key()) .set_initial_balance(Hbar.from_tinybars(100_000_000)) ) receipt = tx.freeze_with(client).sign(operator_key).execute(client) + + if receipt.status != ResponseCode.SUCCESS: + print(f"❌ Account creation failed with status: {ResponseCode(receipt.status).name}") + sys.exit(1) + recipient_id = receipt.account_id print(f"✅ Success! Created a new recipient account with ID: {recipient_id}") return recipient_id, recipient_keyAs per coding guidelines: Examples must validate
receipt.statusagainstResponseCodeenums (Priority 1 - Correctness).tests/integration/revenue_generating_topics_e2e_test.py (2)
529-539: Missingfreeze_with(client)in transaction lifecycle.The
AccountCreateTransactioncalls.execute(env.client)without first calling.freeze_with(env.client). Integration tests must follow the explicit end-to-end pattern: construction → freeze_with → sign → execute.🔎 Proposed fix
receipt = ( AccountCreateTransaction() .set_key_without_alias(fee_exempt_key1.public_key()) .set_initial_balance(Hbar(1)) + .freeze_with(env.client) + .sign(fee_exempt_key1) .execute(env.client) )As per coding guidelines: Integration tests should be end-to-end: construct → freeze → sign → execute → verify (Priority 1 - End-to-End Behavior).
592-602: Missingfreeze_with(client)in transaction lifecycle.The
AccountCreateTransactioncalls.execute(env.client)without first calling.freeze_with(env.client). This is the same issue as in the previous test at lines 529-539.🔎 Proposed fix
receipt = ( AccountCreateTransaction() .set_key_without_alias(fee_exempt_key1.public_key()) .set_initial_balance(Hbar(1)) + .freeze_with(env.client) + .sign(fee_exempt_key1) .execute(env.client) )As per coding guidelines: Integration tests should be end-to-end: construct → freeze → sign → execute → verify (Priority 1 - End-to-End Behavior).
examples/tokens/token_revoke_kyc_transaction.py (1)
109-116: Add explicit signing for consistency with other examples.While the transaction includes
.freeze_with(client), it lacks explicit.sign(operator_key)before.execute(client). This is inconsistent with other examples in this PR:
examples/account/account_create_transaction.py(line 85): explicitly signs withoperator_keyexamples/transaction/transfer_transaction_fungible.py(line 62): explicitly signs withoperator_key🔎 Proposed fix
+ # Get the operator key from the client for signing + operator_key = client.operator_private_key + # Create new account with initial balance of 1 HBAR transaction = ( AccountCreateTransaction() .set_key_without_alias(new_account_public_key) .set_initial_balance(Hbar(1)) .freeze_with(client) + .sign(operator_key) ) receipt = transaction.execute(client)As per coding guidelines: Verify correct signing order and ensure explicit
.execute(client)calls follow standard patterns (Priority 2 - Transaction Lifecycle; Priority 4 - Consistency).tests/integration/utils.py (1)
54-67: Consider adding explicitfreeze_with()beforeexecute()for clarity.The transaction is executed without an explicit
freeze_with(self.client)call (line 62). While the client may auto-freeze internally, integration tests should demonstrate the complete lifecycle (construct → freeze → sign → execute) for consistency with examples and to avoid confusion.🔎 Suggested improvement
def create_account(self, initial_hbar: float = 1.0) -> Account: """Create a new account funded with `initial_hbar` HBAR, defaulting to 1.""" key = PrivateKey.generate() tx = ( AccountCreateTransaction() .set_key_without_alias(key.public_key()) .set_initial_balance(Hbar(initial_hbar)) + .freeze_with(self.client) ) receipt = tx.execute(self.client)examples/tokens/token_grant_kyc_transaction.py (1)
106-113: Consider adding explicit.sign()call before execution for clarity.The transaction is frozen (line 110) and executed (line 113) without an explicit sign step. While the client with an operator set may auto-sign, examples should demonstrate the complete lifecycle (freeze → sign → execute) for clarity and consistency with other examples in the codebase.
🔎 Suggested improvement
For account creation, the operator should sign the transaction:
# Create new account with initial balance of 1 HBAR transaction = ( AccountCreateTransaction() .set_key_without_alias(new_account_public_key) .set_initial_balance(Hbar(1)) .freeze_with(client) ) - receipt = transaction.execute(client) + # The operator (payer) must sign account creation transactions + receipt = transaction.sign(client.operator_private_key).execute(client)Note: You'll need to ensure
client.operator_private_keyis accessible, or passoperator_keyfromsetup_client()as a parameter to this function.examples/tokens/account_allowance_approve_transaction.py (1)
51-57: Missingfreeze_with(client)breaks transaction lifecycle.The transaction is missing
freeze_with(client)beforeexecute(client). Per SDK requirements, the lifecycle must be: construction → freeze_with → sign → execute.🔎 Proposed fix
account_receipt = ( AccountCreateTransaction() .set_key_without_alias(account_public_key) .set_initial_balance(Hbar(1)) .set_account_memo("Account for token allowance") + .freeze_with(client) .execute(client) )examples/account/account_allowance_approve_transaction_hbar.py (1)
83-83: Optional: Consider simplifying variable name.The variable name
account_account_idis redundant. Consider renaming toaccount_idfor clarity, consistent with the_idsuffix convention used elsewhere in examples.tests/integration/account_update_transaction_e2e_test.py (1)
186-186: Replace all remaining deprecatedset_key()calls withset_key_without_alias().The
set_key()method inAccountCreateTransactionis deprecated (see SDK source). Lines 186, 238, 276, 305, and 383 still use the deprecated method while lines 28, 104, 142, 341, and 351 have already been migrated toset_key_without_alias(). Complete the migration consistently across this file.
♻️ Duplicate comments (6)
examples/tokens/token_dissociate_transaction.py (1)
57-57: Remove or clarify the inline comment.This comment
# <-- THE FIX: Call as a methodwas already flagged in a previous review as misleading. The actual change is replacing the deprecatedset_key()withset_key_without_alias(), not about "calling as a method" (it was always a method call).For user-facing examples, either remove this contributor-focused comment or replace it with something that explains the SDK usage pattern:
.set_key_without_alias(recipient_key.public_key()) # Associates key without creating an aliasexamples/tokens/token_reject_transaction_fungible_token.py (1)
55-60: API migration correct, but missingfreeze_with(client)(already flagged).The replacement of
set_key()withset_key_without_alias()on line 57 is correct. However, this transaction is missingfreeze_with(client)beforeexecute(client)on line 59, making it inconsistent with all other transactions in this file (see lines 91, 117, 140, 204). This violates the required transaction lifecycle pattern.As noted in the previous review comment, add
freeze_with(client)beforeexecute(client):receipt = ( AccountCreateTransaction() .set_key_without_alias(new_account_public_key) .set_initial_balance(Hbar(1)) + .freeze_with(client) .execute(client) )examples/tokens/token_reject_transaction_nft.py (1)
57-62: Missingfreeze_with(client)in transaction lifecycle.The
AccountCreateTransactioncalls.execute(client)without first calling.freeze_with(client). This violates the SDK transaction lifecycle pattern (construction → freeze_with → sign → execute).🔎 Proposed fix
receipt = ( AccountCreateTransaction() .set_key_without_alias(new_account_public_key) .set_initial_balance(Hbar(1)) + .freeze_with(client) .execute(client) )As per coding guidelines: Verify transaction lifecycle chain (construction → freeze_with → sign → execute) and ensure
freeze_with(client)is called BEFORE signing (Priority 1 - Correctness).examples/tokens/token_create_transaction_wipe_key.py (1)
76-81: Missingfreeze_with(client)breaks transaction lifecycle.The transaction is missing
freeze_with(client)beforeexecute(client). Per SDK requirements, the lifecycle must be: construction → freeze_with → sign → execute.🔎 Proposed fix
tx = ( AccountCreateTransaction() .set_key_without_alias(private_key.public_key()) .set_initial_balance(Hbar(2)) + .freeze_with(client) ) receipt = tx.execute(client)examples/consensus/topic_create_transaction_revenue_generating.py (1)
66-71: Missingfreeze_with(client)breaks transaction lifecycle.The transaction is missing
freeze_with(client)beforeexecute(client). Per SDK requirements, the lifecycle must be: construction → freeze_with → sign → execute.🔎 Proposed fix
receipt = ( AccountCreateTransaction() .set_key_without_alias(account_public_key) .set_initial_balance(initial_balance) + .freeze_with(client) .execute(client) )tests/unit/account_create_transaction_test.py (1)
188-193: Fix syntax error - mismatched parentheses.Line 192 has an extra closing parenthesis that will cause a syntax error. This was flagged in a previous review and needs to be corrected.
🔎 Proposed fix
account_tx = ( AccountCreateTransaction() .set_key_without_alias(new_public_key) .set_initial_balance(100000000) - .set_account_memo("Test account")) + .set_account_memo("Test account") )
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (53)
CHANGELOG.mddocs/sdk_users/running_examples.mdexamples/account/account_allowance_approve_transaction_hbar.pyexamples/account/account_allowance_approve_transaction_nft.pyexamples/account/account_allowance_delete_transaction_hbar.pyexamples/account/account_allowance_delete_transaction_nft.pyexamples/account/account_create_transaction.pyexamples/account/account_delete_transaction.pyexamples/account/account_records_query.pyexamples/account/account_update_transaction.pyexamples/consensus/topic_create_transaction_revenue_generating.pyexamples/logger/logging_example.pyexamples/query/account_balance_query_2.pyexamples/query/account_info_query.pyexamples/query/transaction_get_receipt_query.pyexamples/query/transaction_record_query.pyexamples/schedule/schedule_create_transaction.pyexamples/schedule/schedule_delete_transaction.pyexamples/schedule/schedule_info_query.pyexamples/schedule/schedule_sign_transaction.pyexamples/tokens/account_allowance_approve_transaction.pyexamples/tokens/token_airdrop_claim_auto.pyexamples/tokens/token_airdrop_claim_signature_required.pyexamples/tokens/token_airdrop_transaction.pyexamples/tokens/token_airdrop_transaction_cancel.pyexamples/tokens/token_associate_transaction.pyexamples/tokens/token_create_transaction_freeze_key.pyexamples/tokens/token_create_transaction_kyc_key.pyexamples/tokens/token_create_transaction_max_automatic_token_associations_0.pyexamples/tokens/token_create_transaction_pause_key.pyexamples/tokens/token_create_transaction_wipe_key.pyexamples/tokens/token_dissociate_transaction.pyexamples/tokens/token_grant_kyc_transaction.pyexamples/tokens/token_reject_transaction_fungible_token.pyexamples/tokens/token_reject_transaction_nft.pyexamples/tokens/token_revoke_kyc_transaction.pyexamples/tokens/token_wipe_transaction.pyexamples/transaction/transfer_transaction_fungible.pyexamples/transaction/transfer_transaction_hbar.pyexamples/transaction/transfer_transaction_nft.pytests/integration/account_info_query_e2e_test.pytests/integration/account_update_transaction_e2e_test.pytests/integration/batch_transaction_e2e_test.pytests/integration/query_e2e_test.pytests/integration/revenue_generating_topics_e2e_test.pytests/integration/token_grant_kyc_transaction_e2e_test.pytests/integration/token_reject_transaction_e2e_test.pytests/integration/token_revoke_kyc_transaction_e2e_test.pytests/integration/token_update_transaction_e2e_test.pytests/integration/transaction_record_query_e2e_test.pytests/integration/utils.pytests/unit/account_create_transaction_test.pytests/unit/executable_test.py
🧰 Additional context used
📓 Path-based instructions (5)
examples/**/*
⚙️ CodeRabbit configuration file
examples/**/*: You are acting as a senior maintainer reviewing SDK examples. Your goal is to ensure examples work verbatim for users who copy-paste them.Priority 1 - Correctness:
- Verify transaction lifecycle chain (construction -> freeze_with -> sign -> execute).
- Ensure
freeze_with(client)is called BEFORE signing.- Validate that methods referenced actually exist in the
hiero_sdk_pythoncodebase.- Ensure response validation checks
receipt.statusagainstResponseCodeenums (e.g.,ResponseCode.SUCCESS).Priority 2 - Transaction Lifecycle:
- Check method chaining logic.
- Verify correct signing order (especially for multi-sig).
- Ensure explicit
.execute(client)calls.- Verify response property extraction (e.g., using
.token_id,.account_id,.serial_numbers).- Ensure error handling uses
ResponseCode(receipt.status).namefor clarity.Priority 3 - Naming & Clarity:
- Enforce role-based naming:
operator_id/_key,treasury_account_id/_key,receiver_id/_key.- Use
_idsuffix for AccountId and_keysuffix for PrivateKey variables.- Validate negative examples explicitly check for failure codes (e.g.,
TOKEN_HAS_NO_PAUSE_KEY).- Ensure logical top-to-bottom flow without ambiguity.
Priority 4 - Consistency:
- Verify standard patterns:
def main(),if __name__ == "__main__":,load_dotenv().- IMPORT RULES:
- Accept both top-level imports (e.g.,
from hiero_sdk_python import PrivateKey) and fully qualified imports (e.g.,from hiero_sdk_python.crypto.private_key import PrivateKey).- STRICTLY validate that the import path actually exists in the project structure. Compare against other files in
/examplesor your knowledge of the SDK file tree.- Flag hallucinations immediately (e.g.,
hiero_sdk_python.keysdoes not exist).- Check for
try-exceptblocks withsys.exit(1)for critical failures.Priority 5 - User Experience:
- Ensure comments explain SDK usage patterns (for users,...
Files:
examples/account/account_allowance_approve_transaction_nft.pyexamples/schedule/schedule_create_transaction.pyexamples/tokens/token_airdrop_claim_auto.pyexamples/account/account_update_transaction.pyexamples/tokens/token_airdrop_transaction_cancel.pyexamples/account/account_allowance_delete_transaction_hbar.pyexamples/schedule/schedule_info_query.pyexamples/tokens/token_wipe_transaction.pyexamples/transaction/transfer_transaction_fungible.pyexamples/account/account_records_query.pyexamples/schedule/schedule_delete_transaction.pyexamples/tokens/token_create_transaction_wipe_key.pyexamples/tokens/token_create_transaction_max_automatic_token_associations_0.pyexamples/tokens/token_associate_transaction.pyexamples/query/transaction_record_query.pyexamples/account/account_allowance_delete_transaction_nft.pyexamples/tokens/token_dissociate_transaction.pyexamples/account/account_allowance_approve_transaction_hbar.pyexamples/query/account_balance_query_2.pyexamples/tokens/token_reject_transaction_fungible_token.pyexamples/tokens/token_create_transaction_freeze_key.pyexamples/tokens/account_allowance_approve_transaction.pyexamples/consensus/topic_create_transaction_revenue_generating.pyexamples/logger/logging_example.pyexamples/tokens/token_airdrop_transaction.pyexamples/transaction/transfer_transaction_hbar.pyexamples/tokens/token_create_transaction_pause_key.pyexamples/tokens/token_revoke_kyc_transaction.pyexamples/tokens/token_create_transaction_kyc_key.pyexamples/account/account_create_transaction.pyexamples/tokens/token_airdrop_claim_signature_required.pyexamples/schedule/schedule_sign_transaction.pyexamples/transaction/transfer_transaction_nft.pyexamples/account/account_delete_transaction.pyexamples/query/account_info_query.pyexamples/tokens/token_grant_kyc_transaction.pyexamples/query/transaction_get_receipt_query.pyexamples/tokens/token_reject_transaction_nft.py
tests/integration/**/*
⚙️ CodeRabbit configuration file
tests/integration/**/*: You are acting as a senior maintainer reviewing integration tests for the hiero-sdk-python project. Your goal is to ensure end-to-end tests validate real network behavior safely and deterministically.CRITICAL PRINCIPLES - Safety & Diagnosability:
- Prioritize safety: No implicit or default mainnet usage.
- Secrets and credentials must be injected safely (env vars, not hardcoded).
- Test failures must be diagnosable with clear error messages.
- Tests must assert observable network behavior, not just
SUCCESS.- Failure-path tests must assert specific
ResponseCodevalues (e.g.,TOKEN_HAS_NO_PAUSE_KEY).PRIORITY 1 - End-to-End Behavior:
- Tests should be end-to-end: construct → freeze → sign → execute → verify.
- Validate resulting balances, ownership, and state changes (not just transaction success).
- Assert transaction receipts contain expected data (IDs, serial numbers, etc.).
- Verify network state after operations (e.g., account balance changed, token transferred).
PRIORITY 2 - Test Structure & Maintainability:
- One major behavior per test (clear focus).
- Tests should be readable: clear names, brief docstrings, key inline comments.
- Minimal abstraction layers - prefer clarity over DRY.
- Is the file too monolithic? Flag if tests should be split into smaller modules.
- Are helper functions good candidates for pytest fixtures or shared utilities?
PRIORITY 3 - Isolation & Cleanup:
- Local account creation over operator reuse (avoid state pollution).
- Are accounts, tokens, and allowances properly cleaned up to avoid state leakage?
- Recommend teardown strategies or fixture scoping improvements.
- Tests should not depend on execution order (avoid brittle assumptions).
PRIORITY 4 - Assertions & Coverage:
- Do tests validate only success/failure, or also assert resulting state?
- Suggest additional assertions that would strengthen correctness (balances, allowances, ownership).
- Cover happy paths AND ...
Files:
tests/integration/token_grant_kyc_transaction_e2e_test.pytests/integration/revenue_generating_topics_e2e_test.pytests/integration/query_e2e_test.pytests/integration/batch_transaction_e2e_test.pytests/integration/token_update_transaction_e2e_test.pytests/integration/transaction_record_query_e2e_test.pytests/integration/account_update_transaction_e2e_test.pytests/integration/token_revoke_kyc_transaction_e2e_test.pytests/integration/token_reject_transaction_e2e_test.pytests/integration/utils.pytests/integration/account_info_query_e2e_test.py
docs/**
⚙️ CodeRabbit configuration file
docs/**: You are reviewing documentation for the Hiero Python SDK. These pages serve both SDK users and SDK developers.Priority 1 - Correctness (code, commands, links)
- Verify code snippets conceptually run and match the current SDK API.
- Check shell commands and workflow steps against actual project tooling.
- Validate URLs and cross-references; flag broken or misleading links.
Priority 2 - Clarity and completeness
- Ensure each page states its purpose and expected outcome early.
- Prefer concrete, step-wise explanations over vague descriptions.
- Highlight missing prerequisites that would block a reader.
- For larger gaps, suggest filing a follow-up issue instead of blocking.
Priority 3 - Consistency and navigation
- Encourage consistent terminology with the SDK and examples.
- Check headings form a logical reading path.
- Confirm each page makes clear which audience it serves.
PHILOSOPHY
- Treat docs as work-in-progress: optimize for correctness and clarity over perfection.
- Keep feedback concise, action-oriented, and focused on reader success.
- Do not request large-scale restructures unless current structure blocks understanding.
AVOID
- Avoid lint-style feedback on Markdown formatting or minor wording.
- Avoid proposing new conventions without clear benefit.
- Avoid turning every high-level gap into a blocker.
Files:
docs/sdk_users/running_examples.md
docs/sdk_users/**
⚙️ CodeRabbit configuration file
docs/sdk_users/**: These documents are for SDK users who want to USE the Hiero Python SDK quickly and correctly.Priority 1 - High-level guidance
- Ensure explanations are conceptual and point to
/examplesfor runnable code.- Check that required environment variables and network choices are clearly stated.
Priority 2 - No hidden assumptions
- Assume zero prior knowledge of this SDK and minimal Hedera background.
- Avoid requiring knowledge of repository layout or contribution workflow.
PHILOSOPHY
- Keep explanations high-level and conceptual; defer runnable examples to
/examples.- Focus on what users need to know before diving into code examples.
Files:
docs/sdk_users/running_examples.md
tests/unit/**/*
⚙️ CodeRabbit configuration file
tests/unit/**/*: You are acting as a senior maintainer reviewing unit tests for the hiero-sdk-python project. Your goal is to ensure tests are extensive, deterministic, and protect against breaking changes.CRITICAL PRINCIPLES - Tests Must Fail Loudly & Deterministically:
- Tests must provide useful error messages when they fail for future debugging.
- No
print()statements - use assertions with descriptive messages.- No timing-dependent or unseeded random assertions.
- No network calls or external dependencies (unit tests are isolated).
- No unjustified TODOs or skipped tests without tracking issues.
PRIORITY 1 - Protect Against Breaking Changes:
- Assert public attributes exist (e.g.,
assert hasattr(obj, 'account_id')).- Assert return types where relevant (e.g.,
assert isinstance(result, AccountId)).- Assert fluent setters return
self(e.g.,assert tx.set_memo("test") is tx).- Assert backward-compatible defaults are maintained.
- If a breaking change is introduced, tests must assert deprecation behavior and test old behavior until removal.
PRIORITY 2 - Constructor & Setter Behavior:
- Test constructor behavior with valid inputs, edge cases, and invalid inputs.
- Test setter behavior including method chaining (fluent interface).
- Verify that setters validate input and raise appropriate exceptions.
- Test that getters return expected values after construction/setting.
PRIORITY 3 - Comprehensive Coverage:
- Unit tests should be extensive - test even if we don't expect users to use it currently.
- Cover happy paths AND unhappy paths/edge cases.
- Test boundary conditions, null/None values, empty collections, etc.
- Avoid brittle ordering assertions unless order is part of the contract.
PRIORITY 4 - No Mocks for Non-Existent Modules:
- All imports must reference actual SDK modules - no hallucinated paths.
- Validate import paths against the actual
src/hiero_sdk_pythonstructure.- Mocks should only be used for external de...
Files:
tests/unit/executable_test.pytests/unit/account_create_transaction_test.py
🧬 Code graph analysis (51)
examples/account/account_allowance_approve_transaction_nft.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/schedule/schedule_create_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/tokens/token_airdrop_claim_auto.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/account/account_update_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/tokens/token_airdrop_transaction_cancel.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/account/account_allowance_delete_transaction_hbar.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/schedule/schedule_info_query.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/tokens/token_wipe_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/transaction/transfer_transaction_fungible.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/account/account_records_query.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
tests/integration/token_grant_kyc_transaction_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
tests/integration/revenue_generating_topics_e2e_test.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/schedule/schedule_delete_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/tokens/token_create_transaction_wipe_key.py (3)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)tests/unit/conftest.py (1)
private_key(54-56)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
tests/integration/query_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/tokens/token_create_transaction_max_automatic_token_associations_0.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
tests/unit/executable_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/tokens/token_associate_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/query/transaction_record_query.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/account/account_allowance_delete_transaction_nft.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/tokens/token_dissociate_transaction.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/account/account_allowance_approve_transaction_hbar.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
tests/integration/batch_transaction_e2e_test.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (2)
set_key_without_alias(94-107)AccountCreateTransaction(27-380)src/hiero_sdk_python/transaction/transaction.py (1)
batchify(825-840)
examples/query/account_balance_query_2.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/tokens/token_reject_transaction_fungible_token.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
tests/unit/account_create_transaction_test.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (4)
set_key_without_alias(94-107)set_key_with_alias(109-135)AccountCreateTransaction(27-380)set_alias(220-244)src/hiero_sdk_python/crypto/private_key.py (2)
public_key(305-309)PrivateKey(14-471)
examples/tokens/token_create_transaction_freeze_key.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/tokens/account_allowance_approve_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/consensus/topic_create_transaction_revenue_generating.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/logger/logging_example.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/tokens/token_airdrop_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/transaction/transfer_transaction_hbar.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/tokens/token_create_transaction_pause_key.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/tokens/token_revoke_kyc_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
tests/integration/token_update_transaction_e2e_test.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/tokens/token_create_transaction_kyc_key.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
tests/integration/transaction_record_query_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
tests/integration/account_update_transaction_e2e_test.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
tests/integration/token_revoke_kyc_transaction_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/account/account_create_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/tokens/token_airdrop_claim_signature_required.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/schedule/schedule_sign_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/transaction/transfer_transaction_nft.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/account/account_delete_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/query/account_info_query.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
tests/integration/token_reject_transaction_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (2)
set_key_without_alias(94-107)AccountCreateTransaction(27-380)
tests/integration/utils.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/tokens/token_grant_kyc_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/query/transaction_get_receipt_query.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
tests/integration/account_info_query_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/tokens/token_reject_transaction_nft.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Codacy Static Code Analysis
a74ddf6 to
4379de6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (8)
examples/tokens/account_allowance_approve_transaction.py (1)
51-57: Missingfreeze_with(client)breaks transaction lifecycle.The transaction is missing
freeze_with(client)beforeexecute(client). According to SDK requirements, the lifecycle must be: construction → freeze_with → sign → execute.🔎 Proposed fix
account_receipt = ( AccountCreateTransaction() .set_key_without_alias(account_public_key) .set_initial_balance(Hbar(1)) .set_account_memo("Account for token allowance") + .freeze_with(client) .execute(client) )examples/account/account_allowance_delete_transaction_hbar.py (1)
42-47: Missingfreeze_with(client)breaks transaction lifecycle.Per SDK requirements, the transaction lifecycle must be: construction →
freeze_with(client)→ [sign (optional)] →execute(client). This transaction skipsfreeze_with.🔎 Proposed fix
account_receipt = ( AccountCreateTransaction() .set_key_without_alias(account_public_key) .set_initial_balance(Hbar(1)) .set_account_memo("Account for hbar allowance") + .freeze_with(client) .execute(client) )examples/account/account_allowance_approve_transaction_hbar.py (1)
83-83: Optional: Simplify variable name.The variable name
account_account_idis redundant. Consider simplifying toaccount_idfor consistency with other examples in the codebase.🔎 Proposed refactor
- account_account_id = account_receipt.account_id + account_id = account_receipt.account_id - return account_account_id, account_private_key + return account_id, account_private_keytests/integration/account_update_transaction_e2e_test.py (5)
186-186: Incomplete replacement of deprecatedset_key()method.This line still uses the deprecated
set_key()method, but the PR objective is to replace all deprecated usage withset_key_without_alias(). This creates inconsistency within the same file where other tests (lines 28, 104, 142, 341, 351) already use the new method.🔎 Proposed fix
- .set_key(env.operator_key.public_key()) + .set_key_without_alias(env.operator_key.public_key())
238-238: Incomplete replacement of deprecatedset_key()method.This line still uses the deprecated
set_key()method. For consistency with the rest of the file and the PR objective, it should useset_key_without_alias().🔎 Proposed fix
- .set_key(env.operator_key.public_key()) + .set_key_without_alias(env.operator_key.public_key())
276-276: Incomplete replacement of deprecatedset_key()method.This line still uses the deprecated
set_key()method. For consistency with the rest of the file and the PR objective, it should useset_key_without_alias().🔎 Proposed fix
- .set_key(env.operator_key.public_key()) + .set_key_without_alias(env.operator_key.public_key())
305-305: Incomplete replacement of deprecatedset_key()method.This line still uses the deprecated
set_key()method. For consistency with the rest of the file and the PR objective, it should useset_key_without_alias().🔎 Proposed fix
- .set_key(env.operator_key.public_key()) + .set_key_without_alias(env.operator_key.public_key())
383-383: Incomplete replacement of deprecatedset_key()method.This line still uses the deprecated
set_key()method. For consistency with the rest of the file and the PR objective, it should useset_key_without_alias().🔎 Proposed fix
- .set_key(env.operator_key.public_key()) + .set_key_without_alias(env.operator_key.public_key())
♻️ Duplicate comments (7)
examples/tokens/token_dissociate_transaction.py (1)
57-57: Remove or clarify the inline comment.The comment
# <-- THE FIX: Call as a methodis misleading and contributor-focused. It was always a method call—the actual change is replacing the deprecatedset_key()withset_key_without_alias(). Since examples are copied by users, either remove this comment or replace it with something user-facing that explains the SDK behavior:.set_key_without_alias(recipient_key.public_key()) # Associates key without creating an aliasexamples/tokens/token_reject_transaction_nft.py (1)
57-62: Missingfreeze_with(client)in transaction lifecycle.The
AccountCreateTransactioncalls.execute(client)without first calling.freeze_with(client). This violates the SDK transaction lifecycle pattern (construction → freeze_with → sign → execute).🔎 Proposed fix
receipt = ( AccountCreateTransaction() .set_key_without_alias(new_account_public_key) .set_initial_balance(Hbar(1)) + .freeze_with(client) .execute(client) )examples/consensus/topic_create_transaction_revenue_generating.py (1)
66-71: Missingfreeze_with(client)breaks transaction lifecycle.The transaction is missing
freeze_with(client)beforeexecute(client). According to SDK requirements, the lifecycle must be: construction → freeze_with → sign → execute. This issue was previously flagged but remains unresolved.🔎 Proposed fix
receipt = ( AccountCreateTransaction() .set_key_without_alias(account_public_key) .set_initial_balance(initial_balance) + .freeze_with(client) .execute(client) )examples/tokens/token_reject_transaction_fungible_token.py (1)
55-60: Missingfreeze_with(client)for pattern consistency.As noted in a previous review, this
AccountCreateTransactionshould includefreeze_with(client)beforeexecute()to maintain consistency with other transactions in this file.examples/tokens/token_create_transaction_wipe_key.py (1)
76-81: Missingfreeze_with(client)breaks transaction lifecycle.The transaction is missing
freeze_with(client)beforeexecute(client). According to SDK requirements, the lifecycle must be: construction → freeze_with → sign → execute.🔎 Proposed fix
tx = ( AccountCreateTransaction() .set_key_without_alias(private_key.public_key()) .set_initial_balance(Hbar(2)) + .freeze_with(client) ) receipt = tx.execute(client)examples/query/account_balance_query_2.py (1)
57-62: Missingfreeze_with(client)breaks transaction lifecycle.This issue has already been flagged in a previous review. The transaction lifecycle must include
freeze_with(client)beforeexecute(client).tests/unit/account_create_transaction_test.py (1)
188-193: Fix syntax error - mismatched parentheses.Line 192 has an extra closing parenthesis that will cause a syntax error. This issue was previously flagged in a past review but remains unfixed.
🔎 Proposed fix
account_tx = ( AccountCreateTransaction() .set_key_without_alias(new_public_key) .set_initial_balance(100000000) - .set_account_memo("Test account")) + .set_account_memo("Test account") )
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (53)
CHANGELOG.mddocs/sdk_users/running_examples.mdexamples/account/account_allowance_approve_transaction_hbar.pyexamples/account/account_allowance_approve_transaction_nft.pyexamples/account/account_allowance_delete_transaction_hbar.pyexamples/account/account_allowance_delete_transaction_nft.pyexamples/account/account_create_transaction.pyexamples/account/account_delete_transaction.pyexamples/account/account_records_query.pyexamples/account/account_update_transaction.pyexamples/consensus/topic_create_transaction_revenue_generating.pyexamples/logger/logging_example.pyexamples/query/account_balance_query_2.pyexamples/query/account_info_query.pyexamples/query/transaction_get_receipt_query.pyexamples/query/transaction_record_query.pyexamples/schedule/schedule_create_transaction.pyexamples/schedule/schedule_delete_transaction.pyexamples/schedule/schedule_info_query.pyexamples/schedule/schedule_sign_transaction.pyexamples/tokens/account_allowance_approve_transaction.pyexamples/tokens/token_airdrop_claim_auto.pyexamples/tokens/token_airdrop_claim_signature_required.pyexamples/tokens/token_airdrop_transaction.pyexamples/tokens/token_airdrop_transaction_cancel.pyexamples/tokens/token_associate_transaction.pyexamples/tokens/token_create_transaction_freeze_key.pyexamples/tokens/token_create_transaction_kyc_key.pyexamples/tokens/token_create_transaction_max_automatic_token_associations_0.pyexamples/tokens/token_create_transaction_pause_key.pyexamples/tokens/token_create_transaction_wipe_key.pyexamples/tokens/token_dissociate_transaction.pyexamples/tokens/token_grant_kyc_transaction.pyexamples/tokens/token_reject_transaction_fungible_token.pyexamples/tokens/token_reject_transaction_nft.pyexamples/tokens/token_revoke_kyc_transaction.pyexamples/tokens/token_wipe_transaction.pyexamples/transaction/transfer_transaction_fungible.pyexamples/transaction/transfer_transaction_hbar.pyexamples/transaction/transfer_transaction_nft.pytests/integration/account_info_query_e2e_test.pytests/integration/account_update_transaction_e2e_test.pytests/integration/batch_transaction_e2e_test.pytests/integration/query_e2e_test.pytests/integration/revenue_generating_topics_e2e_test.pytests/integration/token_grant_kyc_transaction_e2e_test.pytests/integration/token_reject_transaction_e2e_test.pytests/integration/token_revoke_kyc_transaction_e2e_test.pytests/integration/token_update_transaction_e2e_test.pytests/integration/transaction_record_query_e2e_test.pytests/integration/utils.pytests/unit/account_create_transaction_test.pytests/unit/executable_test.py
🧰 Additional context used
📓 Path-based instructions (5)
examples/**/*
⚙️ CodeRabbit configuration file
examples/**/*: You are acting as a senior maintainer reviewing SDK examples. Your goal is to ensure examples work verbatim for users who copy-paste them.Priority 1 - Correctness:
- Verify transaction lifecycle chain (construction -> freeze_with -> sign -> execute).
- Ensure
freeze_with(client)is called BEFORE signing.- Validate that methods referenced actually exist in the
hiero_sdk_pythoncodebase.- Ensure response validation checks
receipt.statusagainstResponseCodeenums (e.g.,ResponseCode.SUCCESS).Priority 2 - Transaction Lifecycle:
- Check method chaining logic.
- Verify correct signing order (especially for multi-sig).
- Ensure explicit
.execute(client)calls.- Verify response property extraction (e.g., using
.token_id,.account_id,.serial_numbers).- Ensure error handling uses
ResponseCode(receipt.status).namefor clarity.Priority 3 - Naming & Clarity:
- Enforce role-based naming:
operator_id/_key,treasury_account_id/_key,receiver_id/_key.- Use
_idsuffix for AccountId and_keysuffix for PrivateKey variables.- Validate negative examples explicitly check for failure codes (e.g.,
TOKEN_HAS_NO_PAUSE_KEY).- Ensure logical top-to-bottom flow without ambiguity.
Priority 4 - Consistency:
- Verify standard patterns:
def main(),if __name__ == "__main__":,load_dotenv().- IMPORT RULES:
- Accept both top-level imports (e.g.,
from hiero_sdk_python import PrivateKey) and fully qualified imports (e.g.,from hiero_sdk_python.crypto.private_key import PrivateKey).- STRICTLY validate that the import path actually exists in the project structure. Compare against other files in
/examplesor your knowledge of the SDK file tree.- Flag hallucinations immediately (e.g.,
hiero_sdk_python.keysdoes not exist).- Check for
try-exceptblocks withsys.exit(1)for critical failures.Priority 5 - User Experience:
- Ensure comments explain SDK usage patterns (for users,...
Files:
examples/tokens/token_airdrop_claim_signature_required.pyexamples/tokens/token_create_transaction_kyc_key.pyexamples/tokens/token_airdrop_transaction.pyexamples/account/account_allowance_delete_transaction_nft.pyexamples/tokens/token_create_transaction_pause_key.pyexamples/account/account_update_transaction.pyexamples/tokens/token_airdrop_transaction_cancel.pyexamples/account/account_records_query.pyexamples/schedule/schedule_info_query.pyexamples/account/account_allowance_approve_transaction_nft.pyexamples/consensus/topic_create_transaction_revenue_generating.pyexamples/tokens/token_revoke_kyc_transaction.pyexamples/tokens/token_create_transaction_wipe_key.pyexamples/tokens/token_airdrop_claim_auto.pyexamples/schedule/schedule_sign_transaction.pyexamples/transaction/transfer_transaction_nft.pyexamples/query/account_balance_query_2.pyexamples/transaction/transfer_transaction_hbar.pyexamples/schedule/schedule_delete_transaction.pyexamples/query/account_info_query.pyexamples/tokens/token_associate_transaction.pyexamples/tokens/account_allowance_approve_transaction.pyexamples/tokens/token_wipe_transaction.pyexamples/account/account_delete_transaction.pyexamples/tokens/token_reject_transaction_fungible_token.pyexamples/tokens/token_dissociate_transaction.pyexamples/account/account_allowance_approve_transaction_hbar.pyexamples/schedule/schedule_create_transaction.pyexamples/transaction/transfer_transaction_fungible.pyexamples/query/transaction_get_receipt_query.pyexamples/tokens/token_create_transaction_freeze_key.pyexamples/account/account_allowance_delete_transaction_hbar.pyexamples/tokens/token_create_transaction_max_automatic_token_associations_0.pyexamples/tokens/token_grant_kyc_transaction.pyexamples/query/transaction_record_query.pyexamples/account/account_create_transaction.pyexamples/logger/logging_example.pyexamples/tokens/token_reject_transaction_nft.py
tests/unit/**/*
⚙️ CodeRabbit configuration file
tests/unit/**/*: You are acting as a senior maintainer reviewing unit tests for the hiero-sdk-python project. Your goal is to ensure tests are extensive, deterministic, and protect against breaking changes.CRITICAL PRINCIPLES - Tests Must Fail Loudly & Deterministically:
- Tests must provide useful error messages when they fail for future debugging.
- No
print()statements - use assertions with descriptive messages.- No timing-dependent or unseeded random assertions.
- No network calls or external dependencies (unit tests are isolated).
- No unjustified TODOs or skipped tests without tracking issues.
PRIORITY 1 - Protect Against Breaking Changes:
- Assert public attributes exist (e.g.,
assert hasattr(obj, 'account_id')).- Assert return types where relevant (e.g.,
assert isinstance(result, AccountId)).- Assert fluent setters return
self(e.g.,assert tx.set_memo("test") is tx).- Assert backward-compatible defaults are maintained.
- If a breaking change is introduced, tests must assert deprecation behavior and test old behavior until removal.
PRIORITY 2 - Constructor & Setter Behavior:
- Test constructor behavior with valid inputs, edge cases, and invalid inputs.
- Test setter behavior including method chaining (fluent interface).
- Verify that setters validate input and raise appropriate exceptions.
- Test that getters return expected values after construction/setting.
PRIORITY 3 - Comprehensive Coverage:
- Unit tests should be extensive - test even if we don't expect users to use it currently.
- Cover happy paths AND unhappy paths/edge cases.
- Test boundary conditions, null/None values, empty collections, etc.
- Avoid brittle ordering assertions unless order is part of the contract.
PRIORITY 4 - No Mocks for Non-Existent Modules:
- All imports must reference actual SDK modules - no hallucinated paths.
- Validate import paths against the actual
src/hiero_sdk_pythonstructure.- Mocks should only be used for external de...
Files:
tests/unit/executable_test.pytests/unit/account_create_transaction_test.py
tests/integration/**/*
⚙️ CodeRabbit configuration file
tests/integration/**/*: You are acting as a senior maintainer reviewing integration tests for the hiero-sdk-python project. Your goal is to ensure end-to-end tests validate real network behavior safely and deterministically.CRITICAL PRINCIPLES - Safety & Diagnosability:
- Prioritize safety: No implicit or default mainnet usage.
- Secrets and credentials must be injected safely (env vars, not hardcoded).
- Test failures must be diagnosable with clear error messages.
- Tests must assert observable network behavior, not just
SUCCESS.- Failure-path tests must assert specific
ResponseCodevalues (e.g.,TOKEN_HAS_NO_PAUSE_KEY).PRIORITY 1 - End-to-End Behavior:
- Tests should be end-to-end: construct → freeze → sign → execute → verify.
- Validate resulting balances, ownership, and state changes (not just transaction success).
- Assert transaction receipts contain expected data (IDs, serial numbers, etc.).
- Verify network state after operations (e.g., account balance changed, token transferred).
PRIORITY 2 - Test Structure & Maintainability:
- One major behavior per test (clear focus).
- Tests should be readable: clear names, brief docstrings, key inline comments.
- Minimal abstraction layers - prefer clarity over DRY.
- Is the file too monolithic? Flag if tests should be split into smaller modules.
- Are helper functions good candidates for pytest fixtures or shared utilities?
PRIORITY 3 - Isolation & Cleanup:
- Local account creation over operator reuse (avoid state pollution).
- Are accounts, tokens, and allowances properly cleaned up to avoid state leakage?
- Recommend teardown strategies or fixture scoping improvements.
- Tests should not depend on execution order (avoid brittle assumptions).
PRIORITY 4 - Assertions & Coverage:
- Do tests validate only success/failure, or also assert resulting state?
- Suggest additional assertions that would strengthen correctness (balances, allowances, ownership).
- Cover happy paths AND ...
Files:
tests/integration/utils.pytests/integration/batch_transaction_e2e_test.pytests/integration/account_update_transaction_e2e_test.pytests/integration/transaction_record_query_e2e_test.pytests/integration/token_reject_transaction_e2e_test.pytests/integration/query_e2e_test.pytests/integration/account_info_query_e2e_test.pytests/integration/revenue_generating_topics_e2e_test.pytests/integration/token_update_transaction_e2e_test.pytests/integration/token_revoke_kyc_transaction_e2e_test.pytests/integration/token_grant_kyc_transaction_e2e_test.py
docs/**
⚙️ CodeRabbit configuration file
docs/**: You are reviewing documentation for the Hiero Python SDK. These pages serve both SDK users and SDK developers.Priority 1 - Correctness (code, commands, links)
- Verify code snippets conceptually run and match the current SDK API.
- Check shell commands and workflow steps against actual project tooling.
- Validate URLs and cross-references; flag broken or misleading links.
Priority 2 - Clarity and completeness
- Ensure each page states its purpose and expected outcome early.
- Prefer concrete, step-wise explanations over vague descriptions.
- Highlight missing prerequisites that would block a reader.
- For larger gaps, suggest filing a follow-up issue instead of blocking.
Priority 3 - Consistency and navigation
- Encourage consistent terminology with the SDK and examples.
- Check headings form a logical reading path.
- Confirm each page makes clear which audience it serves.
PHILOSOPHY
- Treat docs as work-in-progress: optimize for correctness and clarity over perfection.
- Keep feedback concise, action-oriented, and focused on reader success.
- Do not request large-scale restructures unless current structure blocks understanding.
AVOID
- Avoid lint-style feedback on Markdown formatting or minor wording.
- Avoid proposing new conventions without clear benefit.
- Avoid turning every high-level gap into a blocker.
Files:
docs/sdk_users/running_examples.md
docs/sdk_users/**
⚙️ CodeRabbit configuration file
docs/sdk_users/**: These documents are for SDK users who want to USE the Hiero Python SDK quickly and correctly.Priority 1 - High-level guidance
- Ensure explanations are conceptual and point to
/examplesfor runnable code.- Check that required environment variables and network choices are clearly stated.
Priority 2 - No hidden assumptions
- Assume zero prior knowledge of this SDK and minimal Hedera background.
- Avoid requiring knowledge of repository layout or contribution workflow.
PHILOSOPHY
- Keep explanations high-level and conceptual; defer runnable examples to
/examples.- Focus on what users need to know before diving into code examples.
Files:
docs/sdk_users/running_examples.md
🧬 Code graph analysis (48)
examples/tokens/token_airdrop_claim_signature_required.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/tokens/token_create_transaction_kyc_key.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
tests/unit/executable_test.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (2)
PrivateKey(14-471)public_key(305-309)
examples/tokens/token_airdrop_transaction.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/account/account_allowance_delete_transaction_nft.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/tokens/token_create_transaction_pause_key.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/account/account_update_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
tests/integration/utils.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
tests/integration/batch_transaction_e2e_test.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (2)
set_key_without_alias(94-107)AccountCreateTransaction(27-380)src/hiero_sdk_python/transaction/transaction.py (1)
batchify(825-840)
tests/integration/account_update_transaction_e2e_test.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)tests/integration/utils.py (1)
env(23-27)
examples/tokens/token_airdrop_transaction_cancel.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/account/account_records_query.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/schedule/schedule_info_query.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/account/account_allowance_approve_transaction_nft.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/consensus/topic_create_transaction_revenue_generating.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
tests/integration/transaction_record_query_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/tokens/token_revoke_kyc_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/tokens/token_airdrop_claim_auto.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/schedule/schedule_sign_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/transaction/transfer_transaction_nft.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/query/account_balance_query_2.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/transaction/transfer_transaction_hbar.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
tests/integration/token_reject_transaction_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (2)
set_key_without_alias(94-107)AccountCreateTransaction(27-380)
tests/integration/query_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/schedule/schedule_delete_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
tests/integration/account_info_query_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/query/account_info_query.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/tokens/token_associate_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/tokens/account_allowance_approve_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/tokens/token_wipe_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/account/account_delete_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/tokens/token_reject_transaction_fungible_token.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/tokens/token_dissociate_transaction.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
tests/integration/revenue_generating_topics_e2e_test.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/account/account_allowance_approve_transaction_hbar.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/schedule/schedule_create_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/transaction/transfer_transaction_fungible.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
tests/integration/token_revoke_kyc_transaction_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/query/transaction_get_receipt_query.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/tokens/token_create_transaction_freeze_key.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/account/account_allowance_delete_transaction_hbar.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/tokens/token_create_transaction_max_automatic_token_associations_0.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/tokens/token_grant_kyc_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/query/transaction_record_query.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
tests/integration/token_grant_kyc_transaction_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/account/account_create_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/logger/logging_example.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/tokens/token_reject_transaction_nft.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (45)
examples/schedule/schedule_sign_transaction.py (1)
57-65: LGTM! Correct deprecation fix with proper transaction lifecycle.The change from
set_key()toset_key_without_alias()correctly addresses the deprecation. The transaction lifecycle is correct: construction → freeze_with → sign → execute, withfreeze_with(client)properly called before signing. The pattern of setting the public key and signing with the private key is correct.examples/transaction/transfer_transaction_nft.py (1)
59-59: LGTM! Deprecation replacement is correct.The change from
set_key()toset_key_without_alias()properly addresses the deprecation. The method exists in the SDK (as confirmed by the relevant code snippet) and correctly accepts aPublicKey. The transaction lifecycle (construct → freeze_with → execute) is appropriate forAccountCreateTransactionwhere the operator's signature is automatically applied.examples/transaction/transfer_transaction_fungible.py (1)
57-62: LGTM! Correct replacement of deprecated method.The change from
.set_key()to.set_key_without_alias()correctly updates to the non-deprecated API. The transaction lifecycle is correct: construction →freeze_with(client)→sign(operator_key)→execute(client).examples/tokens/token_airdrop_transaction_cancel.py (1)
56-64: LGTM! Correct deprecation replacement and transaction lifecycle.The replacement of
.set_key()with.set_key_without_alias()is correct and aligns with the PR objectives. The transaction lifecycle follows best practices:
- Transaction construction (lines 56-60)
freeze_with(client)called before signing (line 61)- Proper signing and execution chain (line 61)
- Correct response extraction (line 62)
The method exists in the codebase and accepts the correct parameter type (
PublicKeyfromrecipient_key.public_key()).examples/tokens/token_airdrop_claim_signature_required.py (1)
99-108: LGTM! Correct deprecation fix.The replacement of deprecated
set_key()withset_key_without_alias()is correct. The transaction lifecycle follows best practices:
- Proper method chaining
freeze_with(client)called before signing- Signing with
receiver_key(required because signature_required=True)- Explicit
execute(client)callThe use of
receiver_public_keyis appropriate for account creation.examples/tokens/token_create_transaction_pause_key.py (1)
197-197: LGTM! Correct replacement of deprecated method.The change from
set_key()toset_key_without_alias()correctly addresses the deprecation. The transaction lifecycle (freeze_with → sign → execute) is properly maintained, and using the public key for account creation follows SDK best practices. The comment clarifies this for users copying the example.examples/account/account_allowance_approve_transaction_nft.py (1)
84-90: LGTM! Deprecated method correctly replaced.The change from
.set_key(public_key)to.set_key_without_alias(public_key)correctly replaces the deprecated method. The use ofset_key_without_aliasis appropriate here since no alias is being set, and the method signature accepts bothPrivateKeyandPublicKeyper the SDK implementation.Transaction lifecycle is correct:
AccountCreateTransactionis executed directly withoutfreeze_withsince no additional signatures beyond the operator are required.CHANGELOG.md (1)
137-138: LGTM!The changelog entry accurately documents the deprecation replacement across examples and tests.
examples/account/account_records_query.py (1)
50-50: LGTM!The replacement of deprecated
set_key()withset_key_without_alias()is correct. The transaction lifecycle properly callsfreeze_with(client)beforeexecute(client).examples/query/transaction_get_receipt_query.py (1)
52-52: LGTM!The replacement of deprecated
set_key()withset_key_without_alias()is correct. The transaction lifecycle is proper withfreeze_with(client)called before execution on line 55.examples/tokens/token_revoke_kyc_transaction.py (1)
111-111: LGTM!The replacement of deprecated
set_key()withset_key_without_alias()is correct. The transaction lifecycle properly callsfreeze_with(client)before execution on line 113.examples/logger/logging_example.py (1)
110-116: LGTM! Transaction lifecycle is correct.The replacement of
set_key()withset_key_without_alias()is properly integrated. The transaction chain correctly follows: construction →freeze_with(client)→sign()→execute().examples/tokens/token_create_transaction_max_automatic_token_associations_0.py (1)
93-101: LGTM! Transaction lifecycle is correct.The replacement of
set_key()withset_key_without_alias()is properly integrated. The transaction correctly chains: construction →freeze_with(client)→sign()→execute().examples/schedule/schedule_info_query.py (1)
50-58: LGTM! Transaction lifecycle is correct.The replacement of
set_key()withset_key_without_alias()is properly integrated. The transaction correctly follows the required lifecycle: construction →freeze_with(client)→sign()→execute().examples/transaction/transfer_transaction_hbar.py (1)
49-73: LGTM! Correct API migration.The change from
set_key()toset_key_without_alias()is correct, and the transaction lifecycle follows best practices: construct → freeze_with → sign → execute.tests/integration/revenue_generating_topics_e2e_test.py (2)
529-539: LGTM! Correct API usage in test.The change to
set_key_without_alias()is correct. The account is properly created with fee_exempt_key1 and used in the test flow to verify fee exemption behavior.
592-602: LGTM! Correct API usage in test.The change to
set_key_without_alias()is correct and consistent with the pattern used in the other fee-exempt test above.examples/tokens/token_create_transaction_kyc_key.py (1)
76-112: LGTM! Correct API migration with proper transaction lifecycle.The change to
set_key_without_alias()is correct, and the function properly demonstrates the transaction lifecycle with freeze_with → sign → execute.examples/tokens/token_reject_transaction_fungible_token.py (1)
57-57: LGTM! Correct API migration.The change from
set_key()toset_key_without_alias()is correct.examples/tokens/token_create_transaction_freeze_key.py (1)
177-196: LGTM! Correct API migration with exemplary transaction lifecycle.The change to
set_key_without_alias()is correct, and this function demonstrates the proper transaction pattern: construct → freeze_with → sign → execute.examples/tokens/token_airdrop_claim_auto.py (1)
92-92: LGTM - Correct migration to non-deprecated API.The replacement of
set_key()withset_key_without_alias()is correct and maintains the proper transaction lifecycle (construct → freeze_with → sign → execute).tests/integration/batch_transaction_e2e_test.py (1)
280-301: LGTM - Consistent migration across batch transaction test.All three
AccountCreateTransactioninstances correctly useset_key_without_alias()instead of the deprecatedset_key(). The transaction lifecycle is properly maintained with.batchify()handling freeze and sign operations.tests/integration/utils.py (1)
59-59: LGTM - Test utility correctly updated.The migration to
set_key_without_alias()is correct. The helper function maintains proper account creation flow for integration tests.tests/unit/executable_test.py (1)
55-55: LGTM - Consistent migration across unit tests.All nine occurrences of
set_key_without_alias()correctly replace the deprecatedset_key(). These unit tests focus on retry/error handling behavior, and the migration doesn't affect their test logic. Transaction lifecycle is properly maintained across all test cases.Also applies to: 78-78, 118-118, 155-155, 191-191, 222-222, 256-256, 294-294, 410-410
examples/query/transaction_record_query.py (1)
57-57: LGTM - Example correctly updated.The replacement of
set_key()withset_key_without_alias()is correct and demonstrates proper SDK usage. The example maintains the correct transaction flow and response validation.examples/query/account_info_query.py (1)
57-57: LGTM! Method replacement is correct.The change from
set_key()toset_key_without_alias()aligns with the SDK API update, and the transaction lifecycle is complete (freeze_with → sign → execute).examples/tokens/token_grant_kyc_transaction.py (1)
108-108: LGTM! Method replacement is correct.The change from
set_key()toset_key_without_alias()aligns with the SDK API update, and the transaction lifecycle is complete (freeze_with → execute).examples/tokens/token_associate_transaction.py (1)
78-78: LGTM! Method replacement is correct.The change from
set_key()toset_key_without_alias()aligns with the SDK API update, and the transaction lifecycle is complete (freeze_with → sign → execute).examples/schedule/schedule_create_transaction.py (1)
46-54: LGTM!The transaction lifecycle is correct (construction → freeze_with → sign → execute), and the replacement of
set_key()withset_key_without_alias()is appropriate.examples/schedule/schedule_delete_transaction.py (1)
51-59: LGTM!The transaction lifecycle is correct (construction → freeze_with → sign → execute), and the replacement of
set_key()withset_key_without_alias()is appropriate.examples/account/account_update_transaction.py (1)
45-53: LGTM!The transaction lifecycle is correct (construction → freeze_with → sign → execute), and the replacement of
set_key()withset_key_without_alias()is appropriate.tests/integration/query_e2e_test.py (1)
25-25: LGTM: Correct replacement of deprecated method.The replacement of
.set_key()with.set_key_without_alias()is correct and aligns with the SDK's updated API. All five test functions properly use the new method while maintaining the same transaction lifecycle and test logic.Also applies to: 75-75, 132-132, 171-171, 217-217
examples/account/account_create_transaction.py (1)
78-78: LGTM: Proper deprecation replacement with correct transaction lifecycle.The replacement of
.set_key()with.set_key_without_alias()is correct. The transaction lifecycle follows best practices: construction →freeze_with(client)→sign(operator_key)→execute(client).examples/tokens/token_wipe_transaction.py (1)
55-55: LGTM: Correct deprecation replacement.The replacement of
.set_key()with.set_key_without_alias()is correct. The transaction is properly frozen withfreeze_with(client)before execution, relying on implicit operator signing which is valid for this use case.tests/integration/token_revoke_kyc_transaction_e2e_test.py (1)
23-23: LGTM: Correct deprecation replacement with proper test assertions.The replacement of
.set_key()with.set_key_without_alias()is correct across all three test functions. The tests properly validate both success and failure paths with specificResponseCodeassertions (e.g.,TOKEN_HAS_NO_KYC_KEY,TOKEN_NOT_ASSOCIATED_TO_ACCOUNT), which aligns with integration testing best practices.Also applies to: 75-75, 127-127
examples/account/account_delete_transaction.py (1)
27-27: LGTM: Correct deprecation replacement with proper transaction lifecycle.The replacement of
.set_key()with.set_key_without_alias()is correct. The transaction lifecycle properly follows the pattern: construction →freeze_with(client)→sign(account_private_key)→execute(client).tests/integration/account_info_query_e2e_test.py (1)
31-31: LGTM: Deprecation fix applied correctly.The change from
set_key()toset_key_without_alias()correctly addresses the deprecation. The method signature and usage pattern remain consistent with the existing code.docs/sdk_users/running_examples.md (1)
123-123: LGTM: Documentation updated correctly.The Method Chaining example now uses
set_key_without_alias()which aligns with the current SDK API. The example maintains the proper transaction lifecycle withfreeze_with(),sign(), andexecute().examples/account/account_allowance_delete_transaction_nft.py (1)
73-73: LGTM: Correct deprecation fix.The change to
set_key_without_alias()correctly replaces the deprecatedset_key()method. The function follows proper variable naming conventions with_keysuffix for PrivateKey and_idsuffix for AccountId.examples/account/account_allowance_approve_transaction_hbar.py (1)
70-70: LGTM: Correct deprecation fix.The change to
set_key_without_alias()correctly replaces the deprecatedset_key()method.examples/tokens/token_airdrop_transaction.py (1)
59-59: LGTM: Correct deprecation fix with proper transaction lifecycle.The change to
set_key_without_alias()correctly replaces the deprecated method. The transaction also follows the proper lifecycle withfreeze_with()→sign()→execute(), which aligns with SDK best practices.tests/integration/token_reject_transaction_e2e_test.py (1)
116-116: LGTM! Consistent replacement of deprecated method.All fluent API calls to
set_key()have been correctly replaced withset_key_without_alias()throughout the file. The changes align with the PR objective and maintain consistency across the test suite.Also applies to: 177-177, 883-883, 903-903
tests/unit/account_create_transaction_test.py (1)
45-45: LGTM! Comprehensive replacement of deprecated method.All test cases have been correctly updated to use
set_key_without_alias()instead of the deprecatedset_key()method. The changes maintain proper fluent interface chaining and test coverage.Also applies to: 70-70, 105-105, 170-170, 190-190, 237-237, 386-386, 394-394
tests/integration/token_grant_kyc_transaction_e2e_test.py (1)
22-22: LGTM! Complete and consistent replacement.All three account creation calls in this file have been correctly updated to use
set_key_without_alias(). The changes are consistent across all test cases.Also applies to: 65-65, 119-119
tests/integration/transaction_record_query_e2e_test.py (1)
25-25: LGTM! Correct replacement of deprecated method.The deprecated
set_key()method has been correctly replaced withset_key_without_alias(), aligning with the PR objective.
56ef986 to
2a2e33d
Compare
Signed-off-by: prishajaiswal75 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (6)
tests/integration/account_update_transaction_e2e_test.py (1)
184-189: Incomplete migration: 5 remaining deprecatedset_key()calls in AccountCreateTransaction.AccountCreateTransaction.set_key() is deprecated (marked with DeprecationWarning in the SDK). These 5 calls should be migrated to set_key_without_alias():
- Line 186 in
test_integration_account_update_transaction_invalid_auto_renew_period- Line 238 in
test_account_update_insufficient_fee_with_valid_expiration_bump- Line 276 in
test_integration_account_update_transaction_with_only_account_id- Line 305 in
test_integration_account_update_transaction_with_max_automatic_token_associations- Line 383 in
test_integration_account_update_transaction_with_staked_node_idNote: There is also an AccountUpdateTransaction.set_key() at line 51 that may need similar review depending on your PR scope.
tests/integration/account_info_query_e2e_test.py (1)
29-35: Critical: Missingfreeze_with(client)violates transaction lifecycle.The transaction skips
freeze_with(client)beforeexecute(client). Per SDK requirements, the lifecycle must be: construction → freeze_with → sign → execute. Even though this test may currently pass, it doesn't follow the documented transaction pattern and may break if SDK enforcement changes.🔎 Proposed fix
receipt = ( AccountCreateTransaction() .set_key_without_alias(new_account_public_key) .set_initial_balance(Hbar(1)) .set_account_memo(account_memo) + .freeze_with(client) .execute(client) )examples/account/account_allowance_delete_transaction_hbar.py (1)
56-56: Consider renaming for clarity.The variable name
account_account_idis redundant. Consider simplifying toaccount_idfor better readability.🔎 Proposed refactor
- account_account_id = account_receipt.account_id + account_id = account_receipt.account_id - return account_account_id, account_private_key + return account_id, account_private_keytests/unit/account_create_transaction_test.py (1)
287-287: Fix typo in function name.The function name contains a typo: "seperate" should be "separate".
🔎 Proposed fix
-def test_create_account_transaction_set_key_with_seperate_key_for_alias(mock_account_ids): - """Test Create account transaction using set_key_with_alias method with seprate key""" +def test_create_account_transaction_set_key_with_separate_key_for_alias(mock_account_ids): + """Test Create account transaction using set_key_with_alias method with separate key"""examples/tokens/token_revoke_kyc_transaction.py (2)
2-3: Fix typo in usage examples.The file extension is duplicated - should be
.pynot.py.py. Users copying these commands would encounter file-not-found errors.🔎 Proposed fix
-uv run examples/tokens/token_revoke_kyc_transaction.py.py -python examples/tokens/token_revoke_kyc_transaction.py.py +uv run examples/tokens/token_revoke_kyc_transaction.py +python examples/tokens/token_revoke_kyc_transaction.py
51-67: Add freeze_with(client) to TokenCreateTransaction for consistency.The TokenCreateTransaction at lines 51-67 executes directly without
freeze_with(client), which is inconsistent with all other transactions in this example: TokenAssociateTransaction (line 87), AccountCreateTransaction (line 113), TokenGrantKycTransaction (line 138), and TokenRevokeKycTransaction (line 184) all usefreeze_with(client)before signing and executing.Per the transaction lifecycle (construction → freeze_with → sign → execute), add
.freeze_with(client)before.execute(client)to align with the pattern used elsewhere in this file.
♻️ Duplicate comments (9)
examples/tokens/token_dissociate_transaction.py (1)
57-57: Remove or clarify the contributor-focused inline comment.The comment
# <-- THE FIX: Call as a methodis misleading—it was always a method call. The actual change is replacing the deprecatedset_key()withset_key_without_alias(). Since examples are copied by users, either remove this contributor-focused comment or replace it with a user-facing explanation:.set_key_without_alias(recipient_key.public_key()) # Assigns key without creating an account aliasexamples/consensus/topic_create_transaction_revenue_generating.py (1)
66-71: Missingfreeze_with(client)breaks transaction lifecycle.The account creation transaction is missing
freeze_with(client)beforeexecute(client). According to SDK requirements, the lifecycle must be: construction → freeze_with → sign → execute.🔎 Proposed fix
receipt = ( AccountCreateTransaction() .set_key_without_alias(account_public_key) .set_initial_balance(initial_balance) + .freeze_with(client) .execute(client) )tests/integration/token_update_transaction_e2e_test.py (2)
111-116: Missingfreeze_with(client)breaks transaction lifecycle.Integration tests must follow the correct SDK transaction lifecycle: construction → freeze_with → sign → execute. This transaction is missing
freeze_with(client)beforeexecute().🔎 Proposed fix
tx = ( AccountCreateTransaction() .set_key_without_alias(keys[0].public_key()) .set_initial_balance(Hbar(2)) + .freeze_with(env.client) ) receipt = tx.execute(env.client)
175-180: Missingfreeze_with(client)breaks transaction lifecycle.Integration tests must follow the correct SDK transaction lifecycle: construction → freeze_with → sign → execute. This transaction is missing
freeze_with(client)beforeexecute().🔎 Proposed fix
receipt = ( AccountCreateTransaction() .set_key_without_alias(new_public_key) .set_initial_balance(Hbar(2)) + .freeze_with(env.client) .execute(env.client) )examples/tokens/token_create_transaction_wipe_key.py (1)
76-81: Missingfreeze_with(client)breaks transaction lifecycle.The transaction is missing
freeze_with(client)beforeexecute(client). According to SDK requirements, the lifecycle must be: construction → freeze_with → sign → execute.🔎 Proposed fix
tx = ( AccountCreateTransaction() .set_key_without_alias(private_key.public_key()) .set_initial_balance(Hbar(2)) + .freeze_with(client) ) -receipt = tx.execute(client) +receipt = tx.execute(client)examples/tokens/token_reject_transaction_fungible_token.py (1)
55-60: Addfreeze_with(client)for pattern consistency.This
AccountCreateTransactionis the only transaction in the file that calls.execute()directly withoutfreeze_with(). All other transactions (TokenCreateTransaction at line 91, TokenAssociateTransaction at line 117, TransferTransaction at line 140, TokenRejectTransaction at line 204) include thefreeze_with(client)call. For consistency and to demonstrate best practices, add it here.🔎 Proposed fix
receipt = ( AccountCreateTransaction() .set_key_without_alias(new_account_public_key) .set_initial_balance(Hbar(1)) + .freeze_with(client) .execute(client) )examples/query/account_balance_query_2.py (1)
57-62: Critical: Missingfreeze_with(client)violates transaction lifecycle.Per SDK requirements, the transaction lifecycle must be: construction → freeze_with → sign → execute. This transaction skips
freeze_with(client)beforeexecute(client).🔎 Proposed fix
receipt = ( AccountCreateTransaction() .set_key_without_alias(account_public_key) .set_initial_balance(initial_balance) + .freeze_with(client) .execute(client) )examples/tokens/token_reject_transaction_nft.py (1)
57-62: Critical: Missingfreeze_with(client)violates transaction lifecycle.The transaction skips
freeze_with(client)beforeexecute(client). Per SDK requirements, the lifecycle must be: construction → freeze_with → sign → execute.🔎 Proposed fix
receipt = ( AccountCreateTransaction() .set_key_without_alias(new_account_public_key) .set_initial_balance(Hbar(1)) + .freeze_with(client) .execute(client) )tests/unit/account_create_transaction_test.py (1)
188-193: Fix syntax error - mismatched parentheses.Line 192 has an extra closing parenthesis that will cause a syntax error.
🔎 Proposed fix
account_tx = ( AccountCreateTransaction() .set_key_without_alias(new_public_key) .set_initial_balance(100000000) - .set_account_memo("Test account")) + .set_account_memo("Test account") )
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (53)
CHANGELOG.mddocs/sdk_users/running_examples.mdexamples/account/account_allowance_approve_transaction_hbar.pyexamples/account/account_allowance_approve_transaction_nft.pyexamples/account/account_allowance_delete_transaction_hbar.pyexamples/account/account_allowance_delete_transaction_nft.pyexamples/account/account_create_transaction.pyexamples/account/account_delete_transaction.pyexamples/account/account_records_query.pyexamples/account/account_update_transaction.pyexamples/consensus/topic_create_transaction_revenue_generating.pyexamples/logger/logging_example.pyexamples/query/account_balance_query_2.pyexamples/query/account_info_query.pyexamples/query/transaction_get_receipt_query.pyexamples/query/transaction_record_query.pyexamples/schedule/schedule_create_transaction.pyexamples/schedule/schedule_delete_transaction.pyexamples/schedule/schedule_info_query.pyexamples/schedule/schedule_sign_transaction.pyexamples/tokens/account_allowance_approve_transaction.pyexamples/tokens/token_airdrop_claim_auto.pyexamples/tokens/token_airdrop_claim_signature_required.pyexamples/tokens/token_airdrop_transaction.pyexamples/tokens/token_airdrop_transaction_cancel.pyexamples/tokens/token_associate_transaction.pyexamples/tokens/token_create_transaction_freeze_key.pyexamples/tokens/token_create_transaction_kyc_key.pyexamples/tokens/token_create_transaction_max_automatic_token_associations_0.pyexamples/tokens/token_create_transaction_pause_key.pyexamples/tokens/token_create_transaction_wipe_key.pyexamples/tokens/token_dissociate_transaction.pyexamples/tokens/token_grant_kyc_transaction.pyexamples/tokens/token_reject_transaction_fungible_token.pyexamples/tokens/token_reject_transaction_nft.pyexamples/tokens/token_revoke_kyc_transaction.pyexamples/tokens/token_wipe_transaction.pyexamples/transaction/transfer_transaction_fungible.pyexamples/transaction/transfer_transaction_hbar.pyexamples/transaction/transfer_transaction_nft.pytests/integration/account_info_query_e2e_test.pytests/integration/account_update_transaction_e2e_test.pytests/integration/batch_transaction_e2e_test.pytests/integration/query_e2e_test.pytests/integration/revenue_generating_topics_e2e_test.pytests/integration/token_grant_kyc_transaction_e2e_test.pytests/integration/token_reject_transaction_e2e_test.pytests/integration/token_revoke_kyc_transaction_e2e_test.pytests/integration/token_update_transaction_e2e_test.pytests/integration/transaction_record_query_e2e_test.pytests/integration/utils.pytests/unit/account_create_transaction_test.pytests/unit/executable_test.py
🧰 Additional context used
📓 Path-based instructions (5)
tests/integration/**/*
⚙️ CodeRabbit configuration file
tests/integration/**/*: You are acting as a senior maintainer reviewing integration tests for the hiero-sdk-python project. Your goal is to ensure end-to-end tests validate real network behavior safely and deterministically.CRITICAL PRINCIPLES - Safety & Diagnosability:
- Prioritize safety: No implicit or default mainnet usage.
- Secrets and credentials must be injected safely (env vars, not hardcoded).
- Test failures must be diagnosable with clear error messages.
- Tests must assert observable network behavior, not just
SUCCESS.- Failure-path tests must assert specific
ResponseCodevalues (e.g.,TOKEN_HAS_NO_PAUSE_KEY).PRIORITY 1 - End-to-End Behavior:
- Tests should be end-to-end: construct → freeze → sign → execute → verify.
- Validate resulting balances, ownership, and state changes (not just transaction success).
- Assert transaction receipts contain expected data (IDs, serial numbers, etc.).
- Verify network state after operations (e.g., account balance changed, token transferred).
PRIORITY 2 - Test Structure & Maintainability:
- One major behavior per test (clear focus).
- Tests should be readable: clear names, brief docstrings, key inline comments.
- Minimal abstraction layers - prefer clarity over DRY.
- Is the file too monolithic? Flag if tests should be split into smaller modules.
- Are helper functions good candidates for pytest fixtures or shared utilities?
PRIORITY 3 - Isolation & Cleanup:
- Local account creation over operator reuse (avoid state pollution).
- Are accounts, tokens, and allowances properly cleaned up to avoid state leakage?
- Recommend teardown strategies or fixture scoping improvements.
- Tests should not depend on execution order (avoid brittle assumptions).
PRIORITY 4 - Assertions & Coverage:
- Do tests validate only success/failure, or also assert resulting state?
- Suggest additional assertions that would strengthen correctness (balances, allowances, ownership).
- Cover happy paths AND ...
Files:
tests/integration/token_revoke_kyc_transaction_e2e_test.pytests/integration/transaction_record_query_e2e_test.pytests/integration/token_reject_transaction_e2e_test.pytests/integration/token_update_transaction_e2e_test.pytests/integration/query_e2e_test.pytests/integration/batch_transaction_e2e_test.pytests/integration/account_update_transaction_e2e_test.pytests/integration/utils.pytests/integration/revenue_generating_topics_e2e_test.pytests/integration/token_grant_kyc_transaction_e2e_test.pytests/integration/account_info_query_e2e_test.py
examples/**/*
⚙️ CodeRabbit configuration file
examples/**/*: You are acting as a senior maintainer reviewing SDK examples. Your goal is to ensure examples work verbatim for users who copy-paste them.Priority 1 - Correctness:
- Verify transaction lifecycle chain (construction -> freeze_with -> sign -> execute).
- Ensure
freeze_with(client)is called BEFORE signing.- Validate that methods referenced actually exist in the
hiero_sdk_pythoncodebase.- Ensure response validation checks
receipt.statusagainstResponseCodeenums (e.g.,ResponseCode.SUCCESS).Priority 2 - Transaction Lifecycle:
- Check method chaining logic.
- Verify correct signing order (especially for multi-sig).
- Ensure explicit
.execute(client)calls.- Verify response property extraction (e.g., using
.token_id,.account_id,.serial_numbers).- Ensure error handling uses
ResponseCode(receipt.status).namefor clarity.Priority 3 - Naming & Clarity:
- Enforce role-based naming:
operator_id/_key,treasury_account_id/_key,receiver_id/_key.- Use
_idsuffix for AccountId and_keysuffix for PrivateKey variables.- Validate negative examples explicitly check for failure codes (e.g.,
TOKEN_HAS_NO_PAUSE_KEY).- Ensure logical top-to-bottom flow without ambiguity.
Priority 4 - Consistency:
- Verify standard patterns:
def main(),if __name__ == "__main__":,load_dotenv().- IMPORT RULES:
- Accept both top-level imports (e.g.,
from hiero_sdk_python import PrivateKey) and fully qualified imports (e.g.,from hiero_sdk_python.crypto.private_key import PrivateKey).- STRICTLY validate that the import path actually exists in the project structure. Compare against other files in
/examplesor your knowledge of the SDK file tree.- Flag hallucinations immediately (e.g.,
hiero_sdk_python.keysdoes not exist).- Check for
try-exceptblocks withsys.exit(1)for critical failures.Priority 5 - User Experience:
- Ensure comments explain SDK usage patterns (for users,...
Files:
examples/transaction/transfer_transaction_nft.pyexamples/account/account_allowance_approve_transaction_nft.pyexamples/schedule/schedule_create_transaction.pyexamples/logger/logging_example.pyexamples/tokens/token_create_transaction_wipe_key.pyexamples/tokens/token_airdrop_transaction_cancel.pyexamples/account/account_allowance_delete_transaction_nft.pyexamples/tokens/token_create_transaction_pause_key.pyexamples/consensus/topic_create_transaction_revenue_generating.pyexamples/account/account_create_transaction.pyexamples/account/account_allowance_delete_transaction_hbar.pyexamples/account/account_update_transaction.pyexamples/tokens/token_create_transaction_freeze_key.pyexamples/schedule/schedule_sign_transaction.pyexamples/query/account_balance_query_2.pyexamples/account/account_delete_transaction.pyexamples/account/account_allowance_approve_transaction_hbar.pyexamples/schedule/schedule_info_query.pyexamples/tokens/token_airdrop_claim_auto.pyexamples/tokens/token_grant_kyc_transaction.pyexamples/account/account_records_query.pyexamples/tokens/token_airdrop_transaction.pyexamples/query/account_info_query.pyexamples/tokens/token_airdrop_claim_signature_required.pyexamples/tokens/token_create_transaction_kyc_key.pyexamples/tokens/token_wipe_transaction.pyexamples/tokens/token_revoke_kyc_transaction.pyexamples/tokens/token_reject_transaction_nft.pyexamples/query/transaction_record_query.pyexamples/tokens/token_associate_transaction.pyexamples/transaction/transfer_transaction_fungible.pyexamples/schedule/schedule_delete_transaction.pyexamples/query/transaction_get_receipt_query.pyexamples/transaction/transfer_transaction_hbar.pyexamples/tokens/token_reject_transaction_fungible_token.pyexamples/tokens/token_dissociate_transaction.pyexamples/tokens/account_allowance_approve_transaction.pyexamples/tokens/token_create_transaction_max_automatic_token_associations_0.py
tests/unit/**/*
⚙️ CodeRabbit configuration file
tests/unit/**/*: You are acting as a senior maintainer reviewing unit tests for the hiero-sdk-python project. Your goal is to ensure tests are extensive, deterministic, and protect against breaking changes.CRITICAL PRINCIPLES - Tests Must Fail Loudly & Deterministically:
- Tests must provide useful error messages when they fail for future debugging.
- No
print()statements - use assertions with descriptive messages.- No timing-dependent or unseeded random assertions.
- No network calls or external dependencies (unit tests are isolated).
- No unjustified TODOs or skipped tests without tracking issues.
PRIORITY 1 - Protect Against Breaking Changes:
- Assert public attributes exist (e.g.,
assert hasattr(obj, 'account_id')).- Assert return types where relevant (e.g.,
assert isinstance(result, AccountId)).- Assert fluent setters return
self(e.g.,assert tx.set_memo("test") is tx).- Assert backward-compatible defaults are maintained.
- If a breaking change is introduced, tests must assert deprecation behavior and test old behavior until removal.
PRIORITY 2 - Constructor & Setter Behavior:
- Test constructor behavior with valid inputs, edge cases, and invalid inputs.
- Test setter behavior including method chaining (fluent interface).
- Verify that setters validate input and raise appropriate exceptions.
- Test that getters return expected values after construction/setting.
PRIORITY 3 - Comprehensive Coverage:
- Unit tests should be extensive - test even if we don't expect users to use it currently.
- Cover happy paths AND unhappy paths/edge cases.
- Test boundary conditions, null/None values, empty collections, etc.
- Avoid brittle ordering assertions unless order is part of the contract.
PRIORITY 4 - No Mocks for Non-Existent Modules:
- All imports must reference actual SDK modules - no hallucinated paths.
- Validate import paths against the actual
src/hiero_sdk_pythonstructure.- Mocks should only be used for external de...
Files:
tests/unit/account_create_transaction_test.pytests/unit/executable_test.py
docs/**
⚙️ CodeRabbit configuration file
docs/**: You are reviewing documentation for the Hiero Python SDK. These pages serve both SDK users and SDK developers.Priority 1 - Correctness (code, commands, links)
- Verify code snippets conceptually run and match the current SDK API.
- Check shell commands and workflow steps against actual project tooling.
- Validate URLs and cross-references; flag broken or misleading links.
Priority 2 - Clarity and completeness
- Ensure each page states its purpose and expected outcome early.
- Prefer concrete, step-wise explanations over vague descriptions.
- Highlight missing prerequisites that would block a reader.
- For larger gaps, suggest filing a follow-up issue instead of blocking.
Priority 3 - Consistency and navigation
- Encourage consistent terminology with the SDK and examples.
- Check headings form a logical reading path.
- Confirm each page makes clear which audience it serves.
PHILOSOPHY
- Treat docs as work-in-progress: optimize for correctness and clarity over perfection.
- Keep feedback concise, action-oriented, and focused on reader success.
- Do not request large-scale restructures unless current structure blocks understanding.
AVOID
- Avoid lint-style feedback on Markdown formatting or minor wording.
- Avoid proposing new conventions without clear benefit.
- Avoid turning every high-level gap into a blocker.
Files:
docs/sdk_users/running_examples.md
docs/sdk_users/**
⚙️ CodeRabbit configuration file
docs/sdk_users/**: These documents are for SDK users who want to USE the Hiero Python SDK quickly and correctly.Priority 1 - High-level guidance
- Ensure explanations are conceptual and point to
/examplesfor runnable code.- Check that required environment variables and network choices are clearly stated.
Priority 2 - No hidden assumptions
- Assume zero prior knowledge of this SDK and minimal Hedera background.
- Avoid requiring knowledge of repository layout or contribution workflow.
PHILOSOPHY
- Keep explanations high-level and conceptual; defer runnable examples to
/examples.- Focus on what users need to know before diving into code examples.
Files:
docs/sdk_users/running_examples.md
🧬 Code graph analysis (51)
tests/integration/token_revoke_kyc_transaction_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/transaction/transfer_transaction_nft.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/account/account_allowance_approve_transaction_nft.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/schedule/schedule_create_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/logger/logging_example.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
tests/integration/transaction_record_query_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/tokens/token_create_transaction_wipe_key.py (3)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)tests/unit/conftest.py (1)
private_key(54-56)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/tokens/token_airdrop_transaction_cancel.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/account/account_allowance_delete_transaction_nft.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/tokens/token_create_transaction_pause_key.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
tests/integration/token_reject_transaction_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (2)
set_key_without_alias(94-107)AccountCreateTransaction(27-380)
tests/unit/account_create_transaction_test.py (1)
src/hiero_sdk_python/crypto/private_key.py (2)
public_key(305-309)PrivateKey(14-471)
examples/consensus/topic_create_transaction_revenue_generating.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/account/account_create_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/account/account_allowance_delete_transaction_hbar.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
tests/integration/token_update_transaction_e2e_test.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/account/account_update_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/tokens/token_create_transaction_freeze_key.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
tests/integration/query_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/schedule/schedule_sign_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/query/account_balance_query_2.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/account/account_delete_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
tests/integration/batch_transaction_e2e_test.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (2)
set_key_without_alias(94-107)AccountCreateTransaction(27-380)src/hiero_sdk_python/transaction/transaction.py (1)
batchify(825-840)
examples/account/account_allowance_approve_transaction_hbar.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/schedule/schedule_info_query.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
tests/integration/account_update_transaction_e2e_test.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/tokens/token_airdrop_claim_auto.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/tokens/token_grant_kyc_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
tests/integration/utils.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/account/account_records_query.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/tokens/token_airdrop_transaction.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/query/account_info_query.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/tokens/token_airdrop_claim_signature_required.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/tokens/token_create_transaction_kyc_key.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/tokens/token_wipe_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
tests/integration/revenue_generating_topics_e2e_test.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
tests/integration/token_grant_kyc_transaction_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
tests/integration/account_info_query_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/tokens/token_revoke_kyc_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/tokens/token_reject_transaction_nft.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/query/transaction_record_query.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/tokens/token_associate_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/transaction/transfer_transaction_fungible.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/schedule/schedule_delete_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/query/transaction_get_receipt_query.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/transaction/transfer_transaction_hbar.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/tokens/token_reject_transaction_fungible_token.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/tokens/token_dissociate_transaction.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/tokens/account_allowance_approve_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/tokens/token_create_transaction_max_automatic_token_associations_0.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
tests/unit/executable_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (58)
examples/tokens/token_airdrop_claim_signature_required.py (1)
101-101: LGTM! Correct replacement of deprecated method.The migration from
set_key()toset_key_without_alias()is correct. The method accepts thePublicKeyparameter, and the transaction lifecycle (freeze → sign → execute) remains properly sequenced.examples/query/transaction_get_receipt_query.py (5)
11-21: LGTM: Imports are correct.All imports follow the top-level pattern (allowed per guidelines) and reference valid SDK classes.
27-42: LGTM: Client setup follows standard pattern.Proper error handling, role-based naming (
operator_id,operator_key), and clear error messages for users.
45-62: LGTM: Correct replacement of deprecated API.The change from
.set_key()to.set_key_without_alias()is correct:
- Method exists per
account_create_transaction.py(lines 93-106).- Accepts
PublicKeyderived fromrecipient_key.public_key().- Transaction lifecycle is correct:
freeze_with(client)→sign(operator_key)→execute(client).- Response property extraction (
receipt.account_id) is appropriate.This aligns with the PR objective to replace deprecated
set_key()usage.
101-144: LGTM: Query example demonstrates correct SDK patterns.
- Transfer transaction lifecycle is correct (freeze → sign → execute).
- Receipt querying with
set_include_children()andset_include_duplicates()demonstrates SDK capabilities effectively.ResponseCodeusage is appropriate for status display.
147-148: LGTM: Standard main block pattern.examples/tokens/token_wipe_transaction.py (1)
55-55: LGTM! Deprecated method correctly replaced.The replacement of
set_key()withset_key_without_alias()is correct and aligns with the SDK's updated API. The method is properly chained within the transaction lifecycle, and the public key parameter is appropriate.CHANGELOG.md (1)
136-137: LGTM! Clear documentation of the API change.The CHANGELOG entry accurately describes the replacement of deprecated
set_key()withset_key_without_alias()andset_key_with_alias()across examples and tests.examples/query/account_info_query.py (1)
55-63: LGTM! Correct usage ofset_key_without_alias.The transaction lifecycle is correct:
freeze_with(client)→sign(operator_key)→execute(client)The method call properly uses the public key and follows SDK best practices.
examples/logger/logging_example.py (1)
110-116: LGTM! Proper usage ofset_key_without_alias.The transaction correctly:
- Uses
set_key_without_alias(new_key.public_key())for account creation- Follows proper transaction lifecycle:
freeze_with→sign→executeexamples/tokens/token_associate_transaction.py (1)
76-84: LGTM! Correct implementation ofset_key_without_alias.The account creation transaction follows the proper lifecycle:
freeze_with(client)→sign(operator_key)→execute(client)The change aligns with current SDK best practices for account key setup.
examples/transaction/transfer_transaction_nft.py (1)
57-63: LGTM! Proper usage ofset_key_without_alias.The transaction correctly:
- Uses
set_key_without_alias(new_account_public_key)for account creation- Follows transaction lifecycle:
freeze_with(client)→execute(client)The change aligns with the SDK's updated key-setting API.
examples/tokens/account_allowance_approve_transaction.py (1)
53-53: LGTM: Deprecated API correctly replaced.The change from
set_key()toset_key_without_alias()aligns with the SDK's updated API. The method accepts the public key correctly and maintains proper method chaining.examples/transaction/transfer_transaction_fungible.py (1)
59-59: LGTM: Correct API migration.The replacement of
set_key()withset_key_without_alias()is correct. The transaction lifecycle is properly maintained withfreeze_with → sign → execute, and the public key is correctly derived from the generated private key.examples/tokens/token_airdrop_transaction_cancel.py (1)
58-58: LGTM: API update applied correctly.The change from
set_key()toset_key_without_alias()is correct and follows the proper transaction lifecycle pattern withfreeze_with → sign → execute.examples/account/account_allowance_approve_transaction_nft.py (1)
86-86: LGTM: Deprecated method replaced correctly.The migration from
set_key()toset_key_without_alias()is correct. The account creation flow properly validates the response status and handles errors appropriately.tests/integration/token_grant_kyc_transaction_e2e_test.py (1)
22-22: LGTM: Integration tests updated correctly.All three occurrences of the deprecated
set_key()method have been correctly replaced withset_key_without_alias(). The test account creation flows properly validate response status and maintain the expected integration test patterns.Also applies to: 65-65, 119-119
examples/account/account_records_query.py (1)
48-55: LGTM! Correct transaction lifecycle.The replacement of
set_key()withset_key_without_alias()aligns with SDK deprecation. Transaction properly follows: construction → freeze_with → execute.examples/tokens/token_create_transaction_freeze_key.py (1)
181-188: LGTM! Correct transaction lifecycle with signing.The replacement of
set_key()withset_key_without_alias()aligns with SDK deprecation. Transaction properly follows: construction → freeze_with → sign → execute.examples/schedule/schedule_delete_transaction.py (1)
51-59: LGTM! Correct transaction lifecycle with signing.The replacement of
set_key()withset_key_without_alias()aligns with SDK deprecation. Transaction properly follows: construction → freeze_with → sign → execute.examples/tokens/token_airdrop_claim_auto.py (1)
90-99: LGTM! Correct lifecycle pattern.The method change to
set_key_without_alias()is correct, and the transaction properly follows the complete lifecycle: construction → freeze_with → sign → execute.examples/transaction/transfer_transaction_hbar.py (1)
54-59: LGTM! Correct lifecycle pattern.The method change to
set_key_without_alias()is correct, and the transaction properly follows the complete lifecycle: construction → freeze_with → sign → execute.tests/integration/revenue_generating_topics_e2e_test.py (2)
529-534: LGTM! Correct migration toset_key_without_alias.The account creation correctly uses
set_key_without_alias()to associate the fee exempt key without alias handling, aligning with the API migration.
592-597: LGTM! Consistent API usage.The account creation properly uses
set_key_without_alias(), consistent with the pattern established elsewhere in this test suite.tests/integration/account_update_transaction_e2e_test.py (5)
27-33: LGTM! Correct API migration.Account creation properly uses
set_key_without_alias()instead of the deprecatedset_key().
102-107: LGTM! Consistent with API migration.Correctly uses
set_key_without_alias()for account creation with the initial public key.
140-147: LGTM! Proper API usage.Account creation correctly migrated to
set_key_without_alias().
339-344: LGTM! Correct migration.Properly uses
set_key_without_alias()for account creation in the staking test.
349-354: LGTM! Consistent API usage.Account creation correctly uses
set_key_without_alias().examples/tokens/token_grant_kyc_transaction.py (1)
106-111: LGTM! Correct API migration.The account creation transaction correctly uses
set_key_without_alias()and follows the proper transaction lifecycle: construction →freeze_with→execute.examples/account/account_update_transaction.py (1)
45-53: LGTM! Proper API migration.Account creation correctly uses
set_key_without_alias()and demonstrates the complete transaction lifecycle with proper signing.examples/account/account_delete_transaction.py (1)
25-33: LGTM! Correct migration.Account creation properly uses
set_key_without_alias()and follows the complete transaction lifecycle pattern.examples/schedule/schedule_info_query.py (1)
52-52: Correct replacement of deprecated method.The change from
set_key()toset_key_without_alias()is correct and maintains the transaction lifecycle. The method properly accepts the public key and preserves method chaining.examples/schedule/schedule_create_transaction.py (1)
48-48: Correct replacement of deprecated method.The change from
set_key()toset_key_without_alias()correctly updates the account creation flow. The transaction lifecycle remains intact with proper freeze → sign → execute ordering.examples/tokens/token_create_transaction_pause_key.py (1)
197-197: Correct replacement of deprecated method.The change to
set_key_without_alias()is correct and aligns with the inline comment emphasizing public key usage. The transaction lifecycle is properly maintained.tests/integration/query_e2e_test.py (1)
25-25: Correct replacement of deprecated method across all test functions.All five occurrences correctly replace
set_key()withset_key_without_alias(). The changes maintain the existing transaction patterns and don't alter test behavior.Also applies to: 75-75, 132-132, 171-171, 217-217
tests/integration/token_revoke_kyc_transaction_e2e_test.py (1)
23-23: Correct replacement of deprecated method across all test functions.All three occurrences correctly replace
set_key()withset_key_without_alias(). The changes are consistent with the account creation pattern and don't alter the test behavior or lifecycle.Also applies to: 75-75, 127-127
tests/integration/batch_transaction_e2e_test.py (2)
17-26: LGTM: Helper function correctly usesset_key_without_alias.The helper correctly uses the new
set_key_without_aliasAPI. Note that this transaction doesn't callfreeze_withexplicitly because it's a simple account creation without signing requirements beyond the operator signature (implicitly handled during execution).
280-301: LGTM: Test correctly usesset_key_without_aliasin batch context.All three
AccountCreateTransactioninstances correctly useset_key_without_alias. Thebatchify()method internally handlesfreeze_withand signing, so the transaction lifecycle is correct for batch transactions.examples/account/account_create_transaction.py (1)
76-85: LGTM: Correct API usage and transaction lifecycle.The example correctly demonstrates:
- Using
set_key_without_aliasfor the new non-deprecated API- Proper transaction lifecycle:
freeze_with(client).sign(operator_key).execute(client)This is a good reference for users copying example code.
docs/sdk_users/running_examples.md (1)
123-123: Documentation correctly updated to reflect current API.The change from
set_key()toset_key_without_alias()aligns with the SDK's deprecation of the former method. Users following this documentation will now use the recommended API.examples/account/account_allowance_delete_transaction_nft.py (1)
71-77: Correct API migration in account creation.The replacement of
set_key()withset_key_without_alias()properly updates this example to use the non-deprecated method. The transaction lifecycle and method chaining are correct.examples/tokens/token_create_transaction_kyc_key.py (1)
92-99: API update correctly applied with proper transaction lifecycle.The change to
set_key_without_alias()is correct, and the transaction properly follows the freeze_with → sign → execute pattern as required by the SDK.tests/integration/token_reject_transaction_e2e_test.py (4)
115-117: Integration test correctly updated to use current API.The migration from
set_key()toset_key_without_alias()ensures this integration test uses the recommended SDK method. The transaction chain and assertions remain valid.
177-177: Correct API update in test.The change to
set_key_without_alias()properly updates this test to use the non-deprecated method.
883-885: Treasury account creation correctly updated.The API migration to
set_key_without_alias()is correct and maintains the test's integrity for validating receiver signature requirements.
903-903: Receiver account creation correctly updated.The change to
set_key_without_alias()properly updates the test to use the current API.examples/schedule/schedule_sign_transaction.py (1)
57-65: Example correctly updated with proper transaction flow.The replacement of
set_key()withset_key_without_alias()updates this example to current SDK best practices. The transaction lifecycle (freeze_with → sign → execute) is correctly implemented.examples/account/account_allowance_approve_transaction_hbar.py (1)
70-70: LGTM! Correct migration from deprecated method.The replacement of
set_key()withset_key_without_alias()is correct and maintains the fluent interface. The transaction lifecycle (construction → execute) is appropriate for operator-signed transactions.examples/tokens/token_airdrop_transaction.py (1)
59-59: LGTM! Correct migration with proper transaction lifecycle.The replacement of
set_key()withset_key_without_alias()is correct. The transaction follows the proper lifecycle: construction → freeze_with → sign → execute.tests/unit/executable_test.py (1)
55-55: LGTM! Consistent migration across all test cases.All occurrences correctly replace
set_key()withset_key_without_alias()while preserving the test logic and fluent interface. The tests continue to properly validate retry behavior, node switching, and error handling.Also applies to: 78-78, 118-118, 155-155, 191-191, 222-222, 256-256, 294-294, 410-410
examples/query/transaction_record_query.py (1)
57-57: LGTM! Correct migration from deprecated method.The replacement of
set_key()withset_key_without_alias()is correct and maintains proper method chaining. The operator-implicit execution pattern is appropriate here.tests/integration/transaction_record_query_e2e_test.py (1)
25-25: LGTM! Correct migration in integration test.The replacement of
set_key()withset_key_without_alias()is correct and maintains the test's end-to-end validation of transaction record queries. The transaction lifecycle and assertions remain appropriate.examples/account/account_allowance_delete_transaction_hbar.py (1)
43-43: LGTM: Correct usage ofset_key_without_alias.The replacement of deprecated
set_key()withset_key_without_alias()is correct and aligns with the updated SDK API.examples/tokens/token_create_transaction_max_automatic_token_associations_0.py (1)
95-95: LGTM: Correct usage ofset_key_without_aliaswith proper transaction lifecycle.The replacement of deprecated
set_key()withset_key_without_alias()is correct. The transaction properly follows the lifecycle: construction →freeze_with(client)→sign(operator_key)→execute(client).tests/unit/account_create_transaction_test.py (2)
45-45: LGTM: Test coverage properly updated forset_key_without_alias.The test suite correctly exercises the new
set_key_without_aliasmethod across multiple scenarios:
- Basic transaction building
- Scheduled transaction bodies
- Transaction signing
- Integration with mock servers
- Validation edge cases
Tests verify both the fluent interface and that the alias field is properly set to
Nonewhen usingset_key_without_alias.Also applies to: 70-70, 105-105, 170-170, 190-190, 237-237
267-286: LGTM: Comprehensive test coverage forset_key_with_aliasfunctionality.The test suite thoroughly covers the new
set_key_with_aliasmethod:
- Alias derivation from ECDSA public keys
- Separate keys for account and alias
- Error handling for non-ECDSA keys
- Support for both
PublicKeyandPrivateKeyinputs- Interaction between
set_key_with_aliasandset_key_without_alias(mutual override behavior)Tests protect against breaking changes by verifying attribute existence, return types, and fluent interface behavior.
Also applies to: 287-307, 308-324, 425-453, 456-481, 483-503, 505-525
examples/tokens/token_revoke_kyc_transaction.py (1)
111-111: LGTM! Correct replacement of deprecated method.The change from
.set_key()to.set_key_without_alias()is the appropriate replacement for the deprecated method. This aligns with the PR objective and SDK best practices. The transaction lifecycle is correct (freeze_with before execute), and no alias is used in this example, makingset_key_without_aliasthe right choice.
2a2e33d to
cee082e
Compare
|
Thank you also thank you for taking my health and delay into consideration |
|
also i had a doubt regarding the coderabbit comments about freeze why are they occuring ? |
|
Congratulations with the signing! |
|
Yes I have I am using the same gcp that I was using in this repo for prev
issues
…On Mon, 5 Jan 2026 at 5:16 AM, exploreriii ***@***.***> wrote:
*exploreriii* left a comment (hiero-ledger/hiero-sdk-python#1355)
<#1355 (comment)>
Congratulations with the signing!
Don't worry about the freeze in this case, code rabbit isn't understanding
subtlety
we usually freeze transactions to explicitly illustrate things in
examples, but its not required as is covered by execute anyway
—
Reply to this email directly, view it on GitHub
<#1355 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BHHZNILXNIOBXDSTMF2DRNT4FGQ5HAVCNFSM6AAAAACQVKTCXOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTOMBYGUZTSMRZGM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
<https://www.facebook.com/SITLavale/>
<https://www.instagram.com/symbiosis_sitpune>
<https://www.linkedin.com/in/sitpune/>
**Disclaimer:** *This
email is governed by the Disclaimer Terms of SIU which may be viewed at
*http://www.siu.edu.in/downloads/email-disclaimer.php
<http://www.siu.edu.in/downloads/email-disclaimer.php>
|
exploreriii
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi! Please fix this outstanding syntax error
.set_account_memo("Test account"))
Thank you so much
|
Yes I would right away
…On Tue, 6 Jan 2026 at 5:44 AM, exploreriii ***@***.***> wrote:
***@***.**** requested changes on this pull request.
Hi! Please fix this outstanding syntax error
.set_account_memo("Test account"))
Thank you so much
—
Reply to this email directly, view it on GitHub
<#1355 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BHHZNILTXK433JGDAYQHQK34FL45HAVCNFSM6AAAAACQVKTCXOVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTMMRYHAZDMMBVGY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
<https://www.facebook.com/SITLavale/>
<https://www.instagram.com/symbiosis_sitpune>
<https://www.linkedin.com/in/sitpune/>
**Disclaimer:** *This
email is governed by the Disclaimer Terms of SIU which may be viewed at
*http://www.siu.edu.in/downloads/email-disclaimer.php
<http://www.siu.edu.in/downloads/email-disclaimer.php>
|
Signed-off-by: prishajaiswal75 <[email protected]>
|
If anyone is available to help see why the unit tests have failed, is there a change in this PR or do we have a general bug? @hiero-ledger/hiero-sdk-python-triage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 9
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (8)
tests/integration/account_update_transaction_e2e_test.py (4)
186-186: Replace deprecatedset_key()withset_key_without_alias().This line still uses the deprecated
set_key()method. For consistency with the PR objective and the rest of this file (lines 28, 104, 142, 341, 351), this should be updated toset_key_without_alias().🔎 Proposed fix
- .set_key(env.operator_key.public_key()) + .set_key_without_alias(env.operator_key.public_key())
238-238: Replace deprecatedset_key()withset_key_without_alias().This line still uses the deprecated
set_key()method. For consistency with the PR objective, update toset_key_without_alias().🔎 Proposed fix
- .set_key(env.operator_key.public_key()) + .set_key_without_alias(env.operator_key.public_key())
276-276: Replace deprecatedset_key()withset_key_without_alias().This line still uses the deprecated
set_key()method. For consistency with the PR objective, update toset_key_without_alias().🔎 Proposed fix
- .set_key(env.operator_key.public_key()) + .set_key_without_alias(env.operator_key.public_key())
383-383: Replace deprecatedset_key()withset_key_without_alias().This line still uses the deprecated
set_key()method. For consistency with the PR objective, update toset_key_without_alias().🔎 Proposed fix
- .set_key(env.operator_key.public_key()) + .set_key_without_alias(env.operator_key.public_key())examples/tokens/account_allowance_approve_transaction.py (1)
51-57: Fix syntax error: extra closing parenthesis.Line 55 has an extra closing parenthesis after
.set_account_memo("Test account"))which causes a syntax error. This was flagged by @exploreriii in the PR comments and must be fixed before merge.🔎 Proposed fix
account_receipt = ( AccountCreateTransaction() .set_key_without_alias(account_public_key) .set_initial_balance(Hbar(1)) - .set_account_memo("Test account")) + .set_account_memo("Test account") .execute(client) )Note: The
set_key_without_alias()change on line 53 is correct.tests/unit/account_create_transaction_test.py (3)
326-346: Critical: Incorrect method usage will cause test to fail.Line 334 calls
set_key_with_alias()with a non-ECDSA key (ED25519), which will raise aValueErrorat runtime. Thepublic_keyon line 329 is generated usingPrivateKey.generate(), which defaults to ED25519, not ECDSA. According to the implementation inaccount_create_transaction.py,set_key_with_alias()attempts to derive an EVM address from the key, which requires an ECDSA key.Since this test is validating the
set_alias()method (line 335) and manually provides the EVM address, useset_key_without_alias()instead.🔎 Proposed fix
tx = ( AccountCreateTransaction() - .set_key_with_alias(public_key) + .set_key_without_alias(public_key) .set_alias(evm_address) )
348-372: Critical: Incorrect method usage will cause test to fail.Line 360 has the same issue as the previous test. It calls
set_key_with_alias()with a non-ECDSA key (line 352 generates an ED25519 key), which will raise aValueError. This test validatesset_alias()with string input, so useset_key_without_alias()instead.🔎 Proposed fix
tx = ( AccountCreateTransaction() - .set_key_with_alias(public_key) + .set_key_without_alias(public_key) .set_alias(alias_str) )
248-258: Consider adding fluent interface assertions.While the tests use method chaining, they don't explicitly verify that setters return
self. Per the coding guidelines (PRIORITY 2), tests should assert that fluent setters returnselfto protect against breaking changes.Consider adding assertions like:
assert tx.set_key_without_alias(public_key) is txThis can be added to existing tests or as a dedicated test. Based on learnings, testing the fluent interface contract is important for SDK maintainability.
As per coding guidelines, tests should protect against breaking changes to the fluent interface pattern.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (53)
CHANGELOG.mddocs/sdk_users/running_examples.mdexamples/account/account_allowance_approve_transaction_hbar.pyexamples/account/account_allowance_approve_transaction_nft.pyexamples/account/account_allowance_delete_transaction_hbar.pyexamples/account/account_allowance_delete_transaction_nft.pyexamples/account/account_create_transaction.pyexamples/account/account_delete_transaction.pyexamples/account/account_records_query.pyexamples/account/account_update_transaction.pyexamples/consensus/topic_create_transaction_revenue_generating.pyexamples/logger/logging_example.pyexamples/query/account_balance_query_2.pyexamples/query/account_info_query.pyexamples/query/transaction_get_receipt_query.pyexamples/query/transaction_record_query.pyexamples/schedule/schedule_create_transaction.pyexamples/schedule/schedule_delete_transaction.pyexamples/schedule/schedule_info_query.pyexamples/schedule/schedule_sign_transaction.pyexamples/tokens/account_allowance_approve_transaction.pyexamples/tokens/token_airdrop_claim_auto.pyexamples/tokens/token_airdrop_claim_signature_required.pyexamples/tokens/token_airdrop_transaction.pyexamples/tokens/token_airdrop_transaction_cancel.pyexamples/tokens/token_associate_transaction.pyexamples/tokens/token_create_transaction_freeze_key.pyexamples/tokens/token_create_transaction_kyc_key.pyexamples/tokens/token_create_transaction_max_automatic_token_associations_0.pyexamples/tokens/token_create_transaction_pause_key.pyexamples/tokens/token_create_transaction_wipe_key.pyexamples/tokens/token_dissociate_transaction.pyexamples/tokens/token_grant_kyc_transaction.pyexamples/tokens/token_reject_transaction_fungible_token.pyexamples/tokens/token_reject_transaction_nft.pyexamples/tokens/token_revoke_kyc_transaction.pyexamples/tokens/token_wipe_transaction.pyexamples/transaction/transfer_transaction_fungible.pyexamples/transaction/transfer_transaction_hbar.pyexamples/transaction/transfer_transaction_nft.pytests/integration/account_info_query_e2e_test.pytests/integration/account_update_transaction_e2e_test.pytests/integration/batch_transaction_e2e_test.pytests/integration/query_e2e_test.pytests/integration/revenue_generating_topics_e2e_test.pytests/integration/token_grant_kyc_transaction_e2e_test.pytests/integration/token_reject_transaction_e2e_test.pytests/integration/token_revoke_kyc_transaction_e2e_test.pytests/integration/token_update_transaction_e2e_test.pytests/integration/transaction_record_query_e2e_test.pytests/integration/utils.pytests/unit/account_create_transaction_test.pytests/unit/executable_test.py
🧰 Additional context used
📓 Path-based instructions (5)
examples/**/*
⚙️ CodeRabbit configuration file
examples/**/*: You are acting as a senior maintainer reviewing SDK examples. Your goal is to ensure examples work verbatim for users who copy-paste them.Priority 1 - Correctness:
- Verify transaction lifecycle chain (construction -> freeze_with -> sign -> execute).
- Ensure
freeze_with(client)is called BEFORE signing.- Validate that methods referenced actually exist in the
hiero_sdk_pythoncodebase.- Ensure response validation checks
receipt.statusagainstResponseCodeenums (e.g.,ResponseCode.SUCCESS).Priority 2 - Transaction Lifecycle:
- Check method chaining logic.
- Verify correct signing order (especially for multi-sig).
- Ensure explicit
.execute(client)calls.- Verify response property extraction (e.g., using
.token_id,.account_id,.serial_numbers).- Ensure error handling uses
ResponseCode(receipt.status).namefor clarity.Priority 3 - Naming & Clarity:
- Enforce role-based naming:
operator_id/_key,treasury_account_id/_key,receiver_id/_key.- Use
_idsuffix for AccountId and_keysuffix for PrivateKey variables.- Validate negative examples explicitly check for failure codes (e.g.,
TOKEN_HAS_NO_PAUSE_KEY).- Ensure logical top-to-bottom flow without ambiguity.
Priority 4 - Consistency:
- Verify standard patterns:
def main(),if __name__ == "__main__":,load_dotenv().- IMPORT RULES:
- Accept both top-level imports (e.g.,
from hiero_sdk_python import PrivateKey) and fully qualified imports (e.g.,from hiero_sdk_python.crypto.private_key import PrivateKey).- STRICTLY validate that the import path actually exists in the project structure. Compare against other files in
/examplesor your knowledge of the SDK file tree.- Flag hallucinations immediately (e.g.,
hiero_sdk_python.keysdoes not exist).- Check for
try-exceptblocks withsys.exit(1)for critical failures.Priority 5 - User Experience:
- Ensure comments explain SDK usage patterns (for users,...
Files:
examples/tokens/token_reject_transaction_fungible_token.pyexamples/tokens/token_create_transaction_kyc_key.pyexamples/tokens/token_wipe_transaction.pyexamples/schedule/schedule_delete_transaction.pyexamples/account/account_create_transaction.pyexamples/account/account_allowance_approve_transaction_hbar.pyexamples/transaction/transfer_transaction_fungible.pyexamples/schedule/schedule_info_query.pyexamples/tokens/token_airdrop_claim_auto.pyexamples/tokens/token_create_transaction_freeze_key.pyexamples/tokens/token_associate_transaction.pyexamples/account/account_allowance_delete_transaction_nft.pyexamples/query/transaction_record_query.pyexamples/tokens/account_allowance_approve_transaction.pyexamples/tokens/token_airdrop_transaction.pyexamples/query/transaction_get_receipt_query.pyexamples/tokens/token_airdrop_transaction_cancel.pyexamples/logger/logging_example.pyexamples/transaction/transfer_transaction_nft.pyexamples/query/account_balance_query_2.pyexamples/account/account_allowance_approve_transaction_nft.pyexamples/tokens/token_create_transaction_pause_key.pyexamples/tokens/token_airdrop_claim_signature_required.pyexamples/account/account_delete_transaction.pyexamples/schedule/schedule_sign_transaction.pyexamples/consensus/topic_create_transaction_revenue_generating.pyexamples/account/account_allowance_delete_transaction_hbar.pyexamples/tokens/token_create_transaction_max_automatic_token_associations_0.pyexamples/query/account_info_query.pyexamples/transaction/transfer_transaction_hbar.pyexamples/account/account_update_transaction.pyexamples/tokens/token_reject_transaction_nft.pyexamples/tokens/token_create_transaction_wipe_key.pyexamples/tokens/token_dissociate_transaction.pyexamples/account/account_records_query.pyexamples/tokens/token_grant_kyc_transaction.pyexamples/tokens/token_revoke_kyc_transaction.pyexamples/schedule/schedule_create_transaction.py
tests/integration/**/*
⚙️ CodeRabbit configuration file
tests/integration/**/*: You are acting as a senior maintainer reviewing integration tests for the hiero-sdk-python project. Your goal is to ensure end-to-end tests validate real network behavior safely and deterministically.CRITICAL PRINCIPLES - Safety & Diagnosability:
- Prioritize safety: No implicit or default mainnet usage.
- Secrets and credentials must be injected safely (env vars, not hardcoded).
- Test failures must be diagnosable with clear error messages.
- Tests must assert observable network behavior, not just
SUCCESS.- Failure-path tests must assert specific
ResponseCodevalues (e.g.,TOKEN_HAS_NO_PAUSE_KEY).PRIORITY 1 - End-to-End Behavior:
- Tests should be end-to-end: construct → freeze → sign → execute → verify.
- Validate resulting balances, ownership, and state changes (not just transaction success).
- Assert transaction receipts contain expected data (IDs, serial numbers, etc.).
- Verify network state after operations (e.g., account balance changed, token transferred).
PRIORITY 2 - Test Structure & Maintainability:
- One major behavior per test (clear focus).
- Tests should be readable: clear names, brief docstrings, key inline comments.
- Minimal abstraction layers - prefer clarity over DRY.
- Is the file too monolithic? Flag if tests should be split into smaller modules.
- Are helper functions good candidates for pytest fixtures or shared utilities?
PRIORITY 3 - Isolation & Cleanup:
- Local account creation over operator reuse (avoid state pollution).
- Are accounts, tokens, and allowances properly cleaned up to avoid state leakage?
- Recommend teardown strategies or fixture scoping improvements.
- Tests should not depend on execution order (avoid brittle assumptions).
PRIORITY 4 - Assertions & Coverage:
- Do tests validate only success/failure, or also assert resulting state?
- Suggest additional assertions that would strengthen correctness (balances, allowances, ownership).
- Cover happy paths AND ...
Files:
tests/integration/token_grant_kyc_transaction_e2e_test.pytests/integration/token_update_transaction_e2e_test.pytests/integration/batch_transaction_e2e_test.pytests/integration/token_revoke_kyc_transaction_e2e_test.pytests/integration/transaction_record_query_e2e_test.pytests/integration/account_update_transaction_e2e_test.pytests/integration/query_e2e_test.pytests/integration/revenue_generating_topics_e2e_test.pytests/integration/token_reject_transaction_e2e_test.pytests/integration/account_info_query_e2e_test.pytests/integration/utils.py
tests/unit/**/*
⚙️ CodeRabbit configuration file
tests/unit/**/*: You are acting as a senior maintainer reviewing unit tests for the hiero-sdk-python project. Your goal is to ensure tests are extensive, deterministic, and protect against breaking changes.CRITICAL PRINCIPLES - Tests Must Fail Loudly & Deterministically:
- Tests must provide useful error messages when they fail for future debugging.
- No
print()statements - use assertions with descriptive messages.- No timing-dependent or unseeded random assertions.
- No network calls or external dependencies (unit tests are isolated).
- No unjustified TODOs or skipped tests without tracking issues.
PRIORITY 1 - Protect Against Breaking Changes:
- Assert public attributes exist (e.g.,
assert hasattr(obj, 'account_id')).- Assert return types where relevant (e.g.,
assert isinstance(result, AccountId)).- Assert fluent setters return
self(e.g.,assert tx.set_memo("test") is tx).- Assert backward-compatible defaults are maintained.
- If a breaking change is introduced, tests must assert deprecation behavior and test old behavior until removal.
PRIORITY 2 - Constructor & Setter Behavior:
- Test constructor behavior with valid inputs, edge cases, and invalid inputs.
- Test setter behavior including method chaining (fluent interface).
- Verify that setters validate input and raise appropriate exceptions.
- Test that getters return expected values after construction/setting.
PRIORITY 3 - Comprehensive Coverage:
- Unit tests should be extensive - test even if we don't expect users to use it currently.
- Cover happy paths AND unhappy paths/edge cases.
- Test boundary conditions, null/None values, empty collections, etc.
- Avoid brittle ordering assertions unless order is part of the contract.
PRIORITY 4 - No Mocks for Non-Existent Modules:
- All imports must reference actual SDK modules - no hallucinated paths.
- Validate import paths against the actual
src/hiero_sdk_pythonstructure.- Mocks should only be used for external de...
Files:
tests/unit/account_create_transaction_test.pytests/unit/executable_test.py
docs/**
⚙️ CodeRabbit configuration file
docs/**: You are reviewing documentation for the Hiero Python SDK. These pages serve both SDK users and SDK developers.Priority 1 - Correctness (code, commands, links)
- Verify code snippets conceptually run and match the current SDK API.
- Check shell commands and workflow steps against actual project tooling.
- Validate URLs and cross-references; flag broken or misleading links.
Priority 2 - Clarity and completeness
- Ensure each page states its purpose and expected outcome early.
- Prefer concrete, step-wise explanations over vague descriptions.
- Highlight missing prerequisites that would block a reader.
- For larger gaps, suggest filing a follow-up issue instead of blocking.
Priority 3 - Consistency and navigation
- Encourage consistent terminology with the SDK and examples.
- Check headings form a logical reading path.
- Confirm each page makes clear which audience it serves.
PHILOSOPHY
- Treat docs as work-in-progress: optimize for correctness and clarity over perfection.
- Keep feedback concise, action-oriented, and focused on reader success.
- Do not request large-scale restructures unless current structure blocks understanding.
AVOID
- Avoid lint-style feedback on Markdown formatting or minor wording.
- Avoid proposing new conventions without clear benefit.
- Avoid turning every high-level gap into a blocker.
Files:
docs/sdk_users/running_examples.md
docs/sdk_users/**
⚙️ CodeRabbit configuration file
docs/sdk_users/**: These documents are for SDK users who want to USE the Hiero Python SDK quickly and correctly.Priority 1 - High-level guidance
- Ensure explanations are conceptual and point to
/examplesfor runnable code.- Check that required environment variables and network choices are clearly stated.
Priority 2 - No hidden assumptions
- Assume zero prior knowledge of this SDK and minimal Hedera background.
- Avoid requiring knowledge of repository layout or contribution workflow.
PHILOSOPHY
- Keep explanations high-level and conceptual; defer runnable examples to
/examples.- Focus on what users need to know before diving into code examples.
Files:
docs/sdk_users/running_examples.md
🧬 Code graph analysis (50)
examples/tokens/token_reject_transaction_fungible_token.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/tokens/token_create_transaction_kyc_key.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
tests/integration/token_grant_kyc_transaction_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/tokens/token_wipe_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/schedule/schedule_delete_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/account/account_create_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/account/account_allowance_approve_transaction_hbar.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/transaction/transfer_transaction_fungible.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
tests/integration/token_update_transaction_e2e_test.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/schedule/schedule_info_query.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/tokens/token_airdrop_claim_auto.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/tokens/token_create_transaction_freeze_key.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
tests/integration/batch_transaction_e2e_test.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (2)
set_key_without_alias(94-107)AccountCreateTransaction(27-380)src/hiero_sdk_python/transaction/transaction.py (1)
batchify(825-840)
examples/tokens/token_associate_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/account/account_allowance_delete_transaction_nft.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/query/transaction_record_query.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
tests/unit/account_create_transaction_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (4)
set_key_without_alias(94-107)set_key_with_alias(109-135)AccountCreateTransaction(27-380)set_alias(220-244)
examples/tokens/account_allowance_approve_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
tests/integration/token_revoke_kyc_transaction_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/tokens/token_airdrop_transaction.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/tokens/token_airdrop_transaction_cancel.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/logger/logging_example.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
tests/integration/transaction_record_query_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/transaction/transfer_transaction_nft.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/query/account_balance_query_2.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/account/account_allowance_approve_transaction_nft.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
tests/integration/account_update_transaction_e2e_test.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/tokens/token_create_transaction_pause_key.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/tokens/token_airdrop_claim_signature_required.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/account/account_delete_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/schedule/schedule_sign_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/consensus/topic_create_transaction_revenue_generating.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/account/account_allowance_delete_transaction_hbar.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
tests/unit/executable_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
tests/integration/query_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
tests/integration/revenue_generating_topics_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
tests/integration/token_reject_transaction_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (2)
set_key_without_alias(94-107)AccountCreateTransaction(27-380)
tests/integration/account_info_query_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/tokens/token_create_transaction_max_automatic_token_associations_0.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
tests/integration/utils.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/query/account_info_query.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/transaction/transfer_transaction_hbar.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/account/account_update_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/tokens/token_reject_transaction_nft.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/tokens/token_create_transaction_wipe_key.py (3)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)tests/unit/conftest.py (1)
private_key(54-56)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/tokens/token_dissociate_transaction.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)src/hiero_sdk_python/crypto/private_key.py (1)
public_key(305-309)
examples/account/account_records_query.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/tokens/token_grant_kyc_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/tokens/token_revoke_kyc_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
examples/schedule/schedule_create_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
set_key_without_alias(94-107)
🪛 Ruff (0.14.10)
tests/unit/account_create_transaction_test.py
388-388: pytest.raises(ValueError) is too broad, set the match parameter or use a more specific exception
(PT011)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: build-and-test (3.11)
- GitHub Check: build-and-test (3.13)
- GitHub Check: build-and-test (3.12)
- GitHub Check: build-and-test (3.10)
- GitHub Check: run-examples
- GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (47)
examples/tokens/token_airdrop_transaction_cancel.py (1)
56-61: LGTM! Correct replacement of deprecated method.The change from
set_key()toset_key_without_alias()correctly replaces the deprecated method. Since no alias is involved in this account creation,set_key_without_alias()is the appropriate choice. The transaction lifecycle is correct: construct → freeze_with → sign → execute.examples/transaction/transfer_transaction_fungible.py (1)
59-59: LGTM! Correct replacement of deprecated method.The change from
set_key()toset_key_without_alias()correctly addresses the deprecation issue. The method exists in the SDK, accepts the correct Key type, and the transaction lifecycle (construction → freeze_with → sign → execute) is properly maintained.tests/integration/revenue_generating_topics_e2e_test.py (2)
529-534: LGTM! Correct API replacement.The change from
set_key()toset_key_without_alias()correctly applies the new API for account creation without aliasing.
592-597: LGTM! Consistent with the first replacement.The API change is correctly applied for the second fee-exempt account creation.
examples/logger/logging_example.py (1)
110-116: LGTM! Correct lifecycle and API usage.The replacement of
set_key()withset_key_without_alias()is correct, and the transaction follows proper SDK lifecycle withfreeze_with(client)before signing.examples/tokens/token_airdrop_claim_signature_required.py (1)
99-108: LGTM! Complete transaction lifecycle.The API change to
set_key_without_alias()is correct, and the transaction properly follows the SDK pattern: construct → freeze_with → sign → execute.examples/tokens/token_wipe_transaction.py (1)
53-60: LGTM! Proper transaction lifecycle.The change from
set_key()toset_key_without_alias()is correct, andfreeze_with(client)is called before execution as required by SDK best practices.examples/account/account_allowance_approve_transaction_nft.py (1)
86-86: LGTM! Correct replacement of deprecated method.The change from
set_key()toset_key_without_alias()correctly addresses the deprecation. The method call is properly integrated into the account creation flow.examples/schedule/schedule_sign_transaction.py (1)
59-59: LGTM! Correct replacement with proper transaction lifecycle.The change from
set_key()toset_key_without_alias()correctly addresses the deprecation. The transaction demonstrates best practices with explicitfreeze_with→sign→executesequence.examples/query/transaction_get_receipt_query.py (1)
52-52: LGTM! Correct replacement of deprecated method.The change from
set_key()toset_key_without_alias()properly addresses the deprecation. The transaction lifecycle on line 55 correctly appliesfreeze_with→sign→execute.CHANGELOG.md (1)
146-147: LGTM! Clear and accurate changelog entry.The changelog entry correctly documents the replacement of the deprecated
set_key()method across examples and tests. The description is concise and properly categorized.examples/tokens/token_airdrop_claim_auto.py (1)
90-99: LGTM! Correct usage ofset_key_without_aliaswith proper transaction lifecycle.The replacement of
set_keywithset_key_without_aliasis correct and aligns with the SDK API update. The transaction follows the required lifecycle: construction → freeze_with → sign → execute.examples/account/account_records_query.py (1)
48-55: LGTM! Correct usage ofset_key_without_aliaswith proper transaction lifecycle.The replacement of
set_keywithset_key_without_aliasis correct and aligns with the SDK API update. The transaction follows the required lifecycle: construction → freeze_with → execute.examples/tokens/token_create_transaction_pause_key.py (1)
188-212: LGTM!The replacement of
set_key()withset_key_without_alias()is correct. The transaction follows the proper lifecycle: construction → freeze_with → sign → execute. The inline comment clarifying that a public key must be used is helpful for users copying this example.examples/schedule/schedule_delete_transaction.py (1)
46-70: LGTM!The replacement of
set_key()withset_key_without_alias()is correct, and the transaction follows the proper lifecycle: construction → freeze_with → sign → execute. Response validation correctly checks forResponseCode.SUCCESS.examples/query/account_info_query.py (1)
50-74: LGTM!The replacement of
set_key()withset_key_without_alias()is correct, and the transaction follows the proper lifecycle: construction → freeze_with → sign → execute. Response validation and error handling are appropriate for an example script.examples/tokens/token_create_transaction_freeze_key.py (1)
177-196: LGTM!The replacement of
set_key()withset_key_without_alias()is correct, and the transaction follows the proper lifecycle: construction → freeze_with → sign → execute. The account creation is properly integrated into the freeze key demonstration flow.examples/tokens/token_reject_transaction_fungible_token.py (1)
57-57: LGTM: Correct replacement of deprecated method.The change from
set_key()toset_key_without_alias()correctly replaces the deprecated method with the non-aliasing variant, as intended by this PR.docs/sdk_users/running_examples.md (1)
123-123: LGTM: Documentation correctly updated.The documentation example now uses
set_key_without_alias(), accurately reflecting the current SDK API and helping users adopt the non-deprecated method.tests/integration/account_update_transaction_e2e_test.py (1)
28-28: LGTM: Correct replacement of deprecated method.These lines correctly replace
set_key()withset_key_without_alias(), aligning with the PR objective.Also applies to: 104-104, 142-142, 341-341, 351-351
examples/tokens/token_grant_kyc_transaction.py (1)
108-108: LGTM: Correct replacement of deprecated method.The change from
set_key()toset_key_without_alias()correctly replaces the deprecated method. The transaction lifecycle is also properly maintained withfreeze_with(client)included.examples/account/account_update_transaction.py (1)
47-47: LGTM: Correct replacement of deprecated method.The change from
set_key()toset_key_without_alias()correctly replaces the deprecated method. The transaction lifecycle is properly maintained withfreeze_with(),sign(), andexecute()included.examples/tokens/token_create_transaction_kyc_key.py (1)
94-94: LGTM - Correct replacement of deprecated method.The change from
set_key()toset_key_without_alias()is correct and aligns with the SDK's updated API. The transaction lifecycle remains intact with proper ordering: freeze → sign → execute.examples/schedule/schedule_info_query.py (1)
52-52: LGTM - Correct usage of new API method.The replacement of
set_key()withset_key_without_alias()is correct. The account creation flow follows the proper transaction lifecycle with freeze_with → sign → execute.examples/account/account_delete_transaction.py (1)
27-27: LGTM - Proper API migration.The change from
set_key()toset_key_without_alias()correctly uses the non-deprecated API. Transaction chain is properly ordered.examples/schedule/schedule_create_transaction.py (1)
48-48: LGTM - Deprecated method replaced correctly.The replacement with
set_key_without_alias()is correct. The account creation follows the proper transaction lifecycle and will work correctly in the scheduled transaction demonstration.tests/integration/account_info_query_e2e_test.py (1)
31-31: LGTM - Integration test updated correctly.The change from
set_key()toset_key_without_alias()properly updates the test to use the non-deprecated API. The test correctly validates that the key is set as expected (line 43).tests/integration/token_revoke_kyc_transaction_e2e_test.py (3)
23-23: LGTM: Correct API replacement.The replacement of
set_keywithset_key_without_aliasis correct and aligns with the SDK's updated public API.
75-75: LGTM: Correct API replacement.The replacement of
set_keywithset_key_without_aliasis correct and consistent with the other account creation flows in this test file.
127-127: LGTM: Correct API replacement.The replacement of
set_keywithset_key_without_aliasis correct. All three test functions in this file now consistently use the non-deprecated API.examples/account/account_allowance_delete_transaction_nft.py (1)
73-73: LGTM: Correct API replacement.The replacement of
set_keywithset_key_without_aliasis correct and aligns with the SDK's updated public API.examples/account/account_create_transaction.py (1)
78-78: LGTM: Correct API replacement with proper transaction lifecycle.The replacement of
set_keywithset_key_without_aliasis correct. This example also demonstrates the proper transaction lifecycle (construction → freeze_with → sign → execute at line 85), making it a good reference for users.tests/unit/executable_test.py (1)
55-55: LGTM: Correct API replacements across all unit tests.All nine occurrences correctly replace
set_keywithset_key_without_alias. The changes are mechanical and don't affect the test logic—each test continues to validate its intended executable behavior (retry logic, node switching, error handling, etc.).Also applies to: 78-78, 118-118, 155-155, 191-191, 222-222, 256-256, 294-294, 410-410
examples/account/account_allowance_approve_transaction_hbar.py (1)
68-74: LGTM - API migration applied correctly.The replacement of
set_key()withset_key_without_alias()is correct. The transaction lifecycle is valid for operator-paid account creation.tests/integration/query_e2e_test.py (1)
23-28: LGTM - Consistent API migration across all test cases.All five test functions correctly replace
set_key()withset_key_without_alias(). The transaction lifecycle and assertions are proper.Also applies to: 73-78, 130-135, 169-174, 215-220
examples/tokens/token_create_transaction_max_automatic_token_associations_0.py (1)
93-101: LGTM - Exemplary transaction lifecycle.The API migration to
set_key_without_alias()is correct. The explicitfreeze_with(client) -> sign(operator_key) -> execute(client)chain demonstrates best practices for SDK examples.tests/integration/token_reject_transaction_e2e_test.py (1)
115-117: LGTM - API migration applied correctly across test cases.All four occurrences correctly replace
set_key()withset_key_without_alias(). The transaction lifecycle is appropriate for each context:
- Lines 115-117, 177, 903: Simple operator-paid account creation
- Lines 883-885: Properly uses
freeze_with() -> sign()for receiver-signature-required accountAlso applies to: 177-177, 883-885, 903-903
examples/tokens/token_airdrop_transaction.py (1)
57-64: LGTM - Proper transaction lifecycle and API migration.The replacement of
set_key()withset_key_without_alias()is correct. The explicitfreeze_with() -> sign() -> execute()chain demonstrates SDK best practices for examples.examples/tokens/token_associate_transaction.py (1)
78-78: LGTM: Correctly replaced deprecated method.The change from
set_key()toset_key_without_alias()properly aligns with the SDK's deprecation path. The method accepts the public key and correctly sets no alias for this account creation flow.examples/transaction/transfer_transaction_nft.py (1)
59-59: LGTM: Deprecation fix applied correctly.The replacement of
set_key()withset_key_without_alias()is correct. The public key is properly passed to the new method.examples/query/transaction_record_query.py (1)
57-57: LGTM: Correctly migrated to non-deprecated API.The change from
set_key()toset_key_without_alias()is correct. The chainedpublic_key()call properly derives the public key from the private key.examples/account/account_allowance_delete_transaction_hbar.py (1)
43-43: LGTM: Deprecation replacement is correct.The updated method
set_key_without_alias()properly replaces the deprecatedset_key(). The public key parameter is correctly passed.examples/transaction/transfer_transaction_hbar.py (1)
56-56: LGTM: Correct replacement of deprecated method.The change from
set_key()toset_key_without_alias()is correct. This example properly demonstrates the complete transaction lifecycle (construct → freeze → sign → execute) with the updated API.tests/integration/batch_transaction_e2e_test.py (1)
280-301: LGTM! Correct replacement of deprecated method.All three
set_key_without_alias()calls correctly replace the deprecatedset_key()method. The test logic is sound: it validates that successful inner transactions incur fees even when one transaction fails due to missing signatures. The transaction lifecycle (batchify → BatchTransaction.execute) and assertions are appropriate for this integration test.examples/tokens/token_revoke_kyc_transaction.py (1)
109-114: LGTM! Correct replacement of deprecated method.The
set_key_without_alias(new_account_public_key)call correctly replaces the deprecatedset_key()method. The transaction lifecycle (construct → freeze_with → execute) is proper, and the response validation is appropriate.tests/integration/transaction_record_query_e2e_test.py (1)
23-28: LGTM! Correct replacement of deprecated method.The
set_key_without_alias(new_account_public_key)call correctly replaces the deprecatedset_key()method. The test properly validates account creation and subsequently queries the transaction record with appropriate assertions.tests/unit/account_create_transaction_test.py (1)
188-193: LGTM! Syntax error has been fixed.The extra closing parenthesis that was previously flagged on line 192 has been corrected. The code now properly closes the method chain.
|
Hi, this is WorkflowBot.
|
hi @exploreriii, i saw this but i could be wrong, i'm a bit in a rush... |
|
Hi, this is MergeConflictBot. Please resolve these conflicts locally and push the changes. To assist you, please read: Thank you for contributing! |
manishdait
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use set_key_without_alias() instead of set_key_with_alias().
Should i try adding freeze where the code rabblit is suggesting ? |
okayy i would |
Changed from with to without Signed-off-by: prishajaiswal75 <[email protected]>
Signed-off-by: prishajaiswal75 <[email protected]>
|
Hi, sorry about the freeze thing - |
|
Hi @prishajaiswal75 please rebase, accept both changes and I think this is good to go 👍 |
okayy |
Signed-off-by: prishajaiswal75 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
tests/unit/account_create_transaction_test.py (1)
374-389: Consider addingmatchparameter to pytest.raises for more specific validation.The test correctly validates that invalid alias strings raise
ValueError. For improved test specificity, consider adding amatchparameter to validate the error message:with pytest.raises(ValueError, match="invalid.*alias"): tx.set_alias(invalid_str)This would catch cases where a
ValueErroris raised for an unexpected reason.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (2)
CHANGELOG.mdtests/unit/account_create_transaction_test.py
🧰 Additional context used
📓 Path-based instructions (1)
tests/unit/**/*
⚙️ CodeRabbit configuration file
tests/unit/**/*: You are acting as a senior maintainer reviewing unit tests for the hiero-sdk-python project. Your goal is to ensure tests are extensive, deterministic, and protect against breaking changes.CRITICAL PRINCIPLES - Tests Must Fail Loudly & Deterministically:
- Tests must provide useful error messages when they fail for future debugging.
- No
print()statements - use assertions with descriptive messages.- No timing-dependent or unseeded random assertions.
- No network calls or external dependencies (unit tests are isolated).
- No unjustified TODOs or skipped tests without tracking issues.
PRIORITY 1 - Protect Against Breaking Changes:
- Assert public attributes exist (e.g.,
assert hasattr(obj, 'account_id')).- Assert return types where relevant (e.g.,
assert isinstance(result, AccountId)).- Assert fluent setters return
self(e.g.,assert tx.set_memo("test") is tx).- Assert backward-compatible defaults are maintained.
- If a breaking change is introduced, tests must assert deprecation behavior and test old behavior until removal.
PRIORITY 2 - Constructor & Setter Behavior:
- Test constructor behavior with valid inputs, edge cases, and invalid inputs.
- Test setter behavior including method chaining (fluent interface).
- Verify that setters validate input and raise appropriate exceptions.
- Test that getters return expected values after construction/setting.
PRIORITY 3 - Comprehensive Coverage:
- Unit tests should be extensive - test even if we don't expect users to use it currently.
- Cover happy paths AND unhappy paths/edge cases.
- Test boundary conditions, null/None values, empty collections, etc.
- Avoid brittle ordering assertions unless order is part of the contract.
PRIORITY 4 - No Mocks for Non-Existent Modules:
- All imports must reference actual SDK modules - no hallucinated paths.
- Validate import paths against the actual
src/hiero_sdk_pythonstructure.- Mocks should only be used for external de...
Files:
tests/unit/account_create_transaction_test.py
🧠 Learnings (1)
📓 Common learnings
Learnt from: github-actions[bot]
Repo: hiero-ledger/hiero-sdk-python PR: 0
File: :0-0
Timestamp: 2026-01-08T10:28:14.391Z
Learning: In hiero-ledger/hiero-sdk-python, examples should prefer Client.from_env() (src/hiero_sdk_python/client/client.py) for client setup. For examples under examples/tokens, replace manual Network/AccountId/PrivateKey + load_dotenv() bootstrapping with Client.from_env(), and use client.operator_account_id and client.operator_private_key instead of passing operator_id/operator_key through functions.
🧬 Code graph analysis (1)
tests/unit/account_create_transaction_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (3)
set_key_without_alias(94-107)AccountCreateTransaction(27-380)set_alias(220-244)
🪛 Ruff (0.14.10)
tests/unit/account_create_transaction_test.py
388-388: pytest.raises(ValueError) is too broad, set the match parameter or use a more specific exception
(PT011)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (4)
CHANGELOG.md (1)
153-154: LGTM! Changelog entry accurately documents the deprecation replacement.The changelog entry clearly describes the replacement of deprecated
set_key()usage across examples and tests with the new methods. The scope and nature of the change are well documented.tests/unit/account_create_transaction_test.py (3)
45-45: LGTM! Correct replacement of deprecated method across basic account creation tests.All basic account creation tests correctly replace
set_key()withset_key_without_alias(), which is appropriate for these scenarios where no alias functionality is required. The method chaining and test behavior are preserved.Also applies to: 70-70, 105-105, 170-170, 190-190, 237-237
334-335: LGTM! Correct usage pattern for testing independent alias setting.These tests correctly use
set_key_without_alias()followed by separateset_alias()calls, which validates the independent alias-setting API. This pattern is appropriate for testing theset_alias()method in isolation.Also applies to: 360-361, 386-386, 394-394
505-525: LGTM! Important test validates alias clearing behavior.This test correctly verifies that
set_key_without_alias()clears any previously set alias, which is the expected behavior documented in the method contract. The assertion at line 525 confirms the alias is properly set toNone.
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #1355 +/- ##
==========================================
- Coverage 92.44% 92.40% -0.05%
==========================================
Files 139 139
Lines 8528 8528
==========================================
- Hits 7884 7880 -4
- Misses 644 648 +4 🚀 New features to boost your workflow:
|
manishdait
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems good to me
aceppaluni
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@prishajaiswal75 Super great work!!
|
Congratulations ! |
|
Thank you for your help Manish and Antonio and Aceppaluni |
…-ledger#1355) Signed-off-by: prishajaiswal75 <[email protected]> Signed-off-by: prishajaiswal75 <[email protected]>
Thank you :) i would really like to contribute more in order to learn further which kind of PRS should i now pick up considering i am an AIML student are there any repos which i can try as well? |


Description
This PR replaces deprecated
AccountCreateTransaction.set_key()usagewith the appropriate non-deprecated alternatives across examples.
Changes
set_key()callsset_key_without_alias()andset_key_with_alias()where applicableNotes
This PR is opened from a clean branch to avoid unrelated historical commits.
Fixes #1170